I am trying to set a $scope.list variable in angular to be equal to a @users
variable in my rails controller under the index method...any help?
ex: $scope.list = Users.query();
User_profile.rb (controller)
def index
@users = User.all
end
I am trying to set a $scope.list variable in angular to be equal to a
|
||||
This is similar to other problems people have in regards to using JQuery If you take a look at this overview of Angular you will see Angular compiles everything into its own execution context. You need to bring your Rails call to angular in order for the data to appear in the The two options to resolve this are:
|
|||||||||||||||||||||
|
$scope.list
populated and want to set@Users
, or the other way around? – Malkus Aug 2 '13 at 15:52