Change from $scopes.user to $scope.user
On Thu, Mar 19, 2015 at 4:19 PM, Xavier Artot <[email protected]> wrote:
> Hi,
> I beginner, I start this code:
> "The $scope is not defined"
> But I made a console.log($scope) and the object exist?
>
> console.log($scope)
> $get.l.$new.a.$$ChildScope.$$ChildScope {$$childTail: null, $$childHead:
> null, $$nextSibling: null, $$watchers: null, $$listeners: Object…}
> angular.js:11607ReferenceError: $scopes is not defined
>
> The page:
>
> <!DOCTYPE html>
>
> <head>
>
> <meta charset="utf-8">
>
> <title>*1-ex*</title>
>
> </head>
>
> <body ng-app="app">
>
> <div ng-controller='InputCtrl'>
>
> <label for="name">hello {{user.name}} !</label>
>
> <!--<input type="text" name="name" ng-model="user.name" id="name">-->
>
> <!--<div ng-controller='ChildCtrl'>-->
>
> <!--<span>My {{user.name}}</span>-->
>
> <!--</div>-->
>
> </div>
>
> <script type="text/javascript" src="//
> cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script>
>
> <script>
>
> var app = angular.module('app', []);
>
> app.controller('InputCtrl', function($scope) {
>
> console.log($scope);
>
> $scopes.user = { name: 'Cedric' };
>
> });
>
> //app.controller('ChildCtrl', function($scope) {});
>
> </script>
>
> </body>
>
>
>
>
>
>
>
>
>
>
> --
> 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/d/optout.
>
--
*Rishi Tandon*
Pearson Learning Technology Group
Mobile: (310) 926-9032
Pearson
Always Learning
Learn more at www.pearson.com
--
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/d/optout.