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
<div ng-app> | |
<div ng-controller="AppCtrl"> | |
<button ng-click="randomName()">Select Random Name</button> | |
<button ng-click="resetName()">Reset Name</button> | |
<button ng-click="showAsUpperCase()">Show Name In Capital</button> | |
<div>Your name is: {{name}} {{lastName}}</div> | |
<div>Your name was updated {{updateCounter}} times</div> | |
</div> | |
</div> | |
<script> |
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
<div ng-app> | |
<div ng-controller="MyCtrl"> | |
<button ng-click="randomName()">Select Random Name</button> | |
<div>Your name is: {{name}}</div> | |
</div> | |
</div> | |
<script> | |
var myApp = angular.module('myApp',[]); | |
function MyCtrl($scope) { | |
var names = ['Jacob', 'William', 'Michael', 'James', 'Smith', 'Miller']; |