Programming Steps
Step-By-Step Programming For Beginners
Auto-Codes
C Language
Cobol 85 Language
ColdFusion Language
Cordova
HTML5
Java Language
Mobile
Objective-C Language
PhoneGap
PHP
Python Language
Ruby Language
Learn the powerful enterprise adaptable database:
Getting Started With ADABAS & Natural
Thursday, March 3, 2016
w3s115-AngularJS RootScope
w3s115-AngularJS RootScope
code example:
index.html
<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <body ng-app="myApp"> <p>The rootScope's favorite color:</p> <h1>{{color}}</h1> <div ng-controller="myCtrl"> <p>The scope of the controller's favorite color:</p> <h1>{{color}}</h1> </div> <p>The rootScope's favorite color is still:</p> <h1>{{color}}</h1> <script> var app = angular.module('myApp', []); app.run(function($rootScope) { $rootScope.color = 'blue'; }); app.controller('myCtrl', function($scope) { $scope.color = "red"; }); </script> <p>Notice that controller's color variable does not overwrite the rootScope's color value.</p> </body> </html>
https://www.w3schools.com/angular/angular_scopes.asp
201603
Related Posts:
TypeScript Online Editor
What is TypeScript?
Apps Script and JSON Web Token
102 Apps Script: ObjDb Sheet Regist...
AngularJS Basic HTTP Authentication
Related Posts Widget
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment