ng-click

Employee.html
snippet
<div ng-app="payrollApp" ng-controller="employeeController">

<button ng-click="toggle()">Toggle</button>

<p ng-hide="isVisible">
Name:
<input type="text" ng-model="Name">
<br>
</p>

</div>
employeeController.js
snippet
<script>
var app = angular.module('payrollApp', []);
app.controller('employeeController', function($scope) {
$scope.Name = "David"
$scope.isVisible = false;
$scope.toggle = function() {
$scope.isVisible = !$scope.isVisible;
};
});
</script>
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +