Created
November 12, 2018 10:54
-
-
Save shishirarora3/e1559c58b6b5d76f593cc423fb528f65 to your computer and use it in GitHub Desktop.
AngularJS Tutorials // source https://jsbin.com/johaye
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AngularJS Tutorials</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.2/angular.js"></script> | |
</head> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.css"> | |
<body> | |
<div ng-app="app"> | |
<input type="text" ng-model="message"> | |
<h1>{{message}}</h1> | |
<!-- we've replaced the use of $scope with the preferred "controller as" syntax. see: http://toddmotto.com/digging-into-angulars-controller-as-syntax/--> | |
<div ng-controller="FirstCtrl as first"> | |
<input type="text" ng-model="message"> | |
<h1>{{message}}</h1> | |
</div> | |
<div ng-controller="SecondCtrl as second"> | |
<input type="text" ng-model="message"> | |
<h1>{{message}}</h1> | |
</div> | |
</div> | |
<script id="jsbin-javascript"> | |
angular.module('app', []) | |
.controller('FirstCtrl', function FirstCtrl() { | |
var first = this; | |
first.message = "First"; | |
}) | |
.controller('SecondCtrl', function SecondCtrl() { | |
var second = this; | |
second.message = "Second"; | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">angular.module('app', []) | |
.controller('FirstCtrl', function FirstCtrl() { | |
var first = this; | |
first.message = "First"; | |
}) | |
.controller('SecondCtrl', function SecondCtrl() { | |
var second = this; | |
second.message = "Second"; | |
}); | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app', []) | |
.controller('FirstCtrl', function FirstCtrl() { | |
var first = this; | |
first.message = "First"; | |
}) | |
.controller('SecondCtrl', function SecondCtrl() { | |
var second = this; | |
second.message = "Second"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment