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