Hello,
I am trying to do something that would seem fairly simple.
In my controller I have a service that I need to pass a server side
parameter into:
var data = dataService.query({*serverSideVar*:*scope.serverSideVar*},
function() {
});//Get Data
I need to know how to instantiate the server side variable so that it
available at the time of the data call.
I have tried using ng-init on the my controller tag
<div ng-controller="myController" ng-init="instantiateValueInScope('My
Value')">
In my controller used this to try to pass the value:
scope.instantiateValueInScope = function (myValue) {
// This is used on controller load to
// instantiate server side vars
scope.*serverSideVar* = myValue;
};
My variable is not carrying over before the data call happens. How can I
get my server side value into my service call before it fires?
Thanks in advance!
Brad Newman
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.