Created
September 4, 2014 14:18
-
-
Save anonymous/a194f780ba2f362ebb04 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/jodiqotodopi/1
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app="demoApp"> | |
<div ng-controller="myCtrl"> | |
<p>Name:</p> | |
<input type="text" ng-model="newPerson.name"> | |
<p>City:</p> | |
<input type="text" ng-model="newPerson.city"> | |
<button type="submit" ng-click="addPerson()">Submit</button> | |
<ul> | |
<li ng-repeat="person in persons"> | |
{{person.name}} - {{person.city}} | |
</ul> | |
</div> | |
<script id="jsbin-javascript"> | |
var demoApp = angular.module('demoApp',[]); | |
demoApp.controller('myCtrl', function ($scope){ | |
$scope.persons = [ | |
{name: 'Edwin Luisenbarn',city:'Cebu'}, | |
{name: 'JM Rivera',city:'Mandaue'} | |
]; | |
$scope.addPerson = function() { | |
$scope.persons.push({ | |
name:$scope.newPerson.name, | |
city:$scope.newPerson.city | |
}) | |
}; | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app="demoApp"> | |
<div ng-controller="myCtrl"> | |
<p>Name:</p> | |
<input type="text" ng-model="newPerson.name"> | |
<p>City:</p> | |
<input type="text" ng-model="newPerson.city"> | |
<button type="submit" ng-click="addPerson()">Submit</button> | |
<ul> | |
<li ng-repeat="person in persons"> | |
{{person.name}} - {{person.city}} | |
</ul> | |
</div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">var demoApp = angular.module('demoApp',[]); | |
demoApp.controller('myCtrl', function ($scope){ | |
$scope.persons = [ | |
{name: 'Edwin Luisenbarn',city:'Cebu'}, | |
{name: 'JM Rivera',city:'Mandaue'} | |
]; | |
$scope.addPerson = function() { | |
$scope.persons.push({ | |
name:$scope.newPerson.name, | |
city:$scope.newPerson.city | |
}) | |
}; | |
}); | |
</script></body> | |
</html> |
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
var demoApp = angular.module('demoApp',[]); | |
demoApp.controller('myCtrl', function ($scope){ | |
$scope.persons = [ | |
{name: 'Edwin Luisenbarn',city:'Cebu'}, | |
{name: 'JM Rivera',city:'Mandaue'} | |
]; | |
$scope.addPerson = function() { | |
$scope.persons.push({ | |
name:$scope.newPerson.name, | |
city:$scope.newPerson.city | |
}) | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment