Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

My requirement is how can I pass some data to my angular controller from my mvc controller. so that in the angular html view I can use that parameter and search the data from my web api service. as of now my angular view open as blank. and as per the user selection it fetch the data from the service.

but now I need to pass some default parameter on the load of html view.so it should open up with some data.

so I how can I do this.

Below is my controller code.

app.controller('SearchController', ['$scope','$http',function ($scope, $http) {
    $scope.sessionGuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
    $scope.searchValue = "";
    $scope.stockNumber = "";

    $scope.searchRequest = {
        Criteria: [],
        resultsTabIndex: 0,
        orderBy: "sortbypopularity"

    };

Thanks

share|improve this question
    
I'm not sure what distinction you're making between your angular controller and your MVC controller. – A. Duff Mar 9 '15 at 20:58

Finaly I cookies. I create a cookie from my mvc action method and need to read from my angular controller.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.