Created
February 21, 2016 12:58
-
-
Save drawveloper/5f258317f54113c41ae1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// View (a template) | |
<div ng-controller=”HelloController as hello”> | |
<label>Name:</label> | |
<input type=”text” ng-model=”hello.firstName”> | |
<input type=”text” ng-model=”hello.lastName”> | |
<h1>Hello {{hello.fullName()}}!</h1> | |
</div> | |
// Controller | |
angular.module(‘helloApp’, []) | |
.controller(‘HelloController’, function() { | |
var hello = this; | |
hello.fullName = function() { | |
return hello.firstName + hello.lastName; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment