Mafinar Rashid Khan
Product Manager
Panacea Systems Ltd
@mafinar
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
var StatusCtrl = function($scope) {
$scope.status = "";
$scope.statuses = [];
$scope.clearStatus = function() {
$scope.status = "";
}
$scope.saveStatus = function() {
$scope.statuses.push($scope.status);
$scope.clearStatus()
}
$scope.deleteStatus = function(index) {
$scope.statuses.splice(index, 1);
}
}
<div ng-controller="StatusCtrl">
<input ng-model="status" />
<button ng-click="clearStatus()">Clear</button>
<button ng-click="saveStatus()">Save</button>
<hr />
<ul>
<li ng-repeat="s in statuses">
{{ s }} <a href="#" ng-click="deleteStatus($index)">[ X ]</a>
</li>
</ul>
</div>
.phone-form-repeat.ng-enter,
.phone-form-repeat.ng-move {
-webkit-animation: fadeIn 1s;
}
.phone-form-repeat.ng-leave {
-webkit-animation: fadeOut 0.5s;
}
<div ng-repeat="phone in contact.phones"
ng-form="phoneForm"
class="phone-form-repeat">
<!-- the phone related stuff -->
</div>
<form name="contactForm" novalidate>
<div class="form-group">
<input type="email"
required
class="form-control"
name="email"
ng-model="contact.email"
placeholder="[ Email ]" />
<div class="help-block">
<div ng-show="contactForm.email.$invalid && contactForm.email.$dirty && contactForm.email.$error.required">
You must provide an email address
</div>
</div>
<div class="help-block">
<div ng-show="contactForm.email.$invalid && contactForm.email.$dirty && contactForm.email.$error.email">
Invalid email format
</div>
</div>
</div>
</form>