Skip to content

Instantly share code, notes, and snippets.

@DanyRupes
Created February 5, 2018 11:10
Show Gist options
  • Save DanyRupes/d0ab811052d731b0b4f87fd9b72ffa93 to your computer and use it in GitHub Desktop.
Save DanyRupes/d0ab811052d731b0b4f87fd9b72ffa93 to your computer and use it in GitHub Desktop.
MEAN STACK
<!Doctype html>
<html>
<head>
<title>hello</title>
<script src="angular.min.js"></script>
<link rel="stylesheet" href="style.css">
<!--<script src="script.js"></script>-->
<script>
var app = angular.module('person', []);
app.controller('personctrl', function($scope) {
$scope.persons=[];
$scope.firstname="";
$scope.lastname="";
$scope.addusers=function(){
var users={
firstname:$scope.firstname,
lastname:$scope.lastname
};
$scope.persons.push(users);
}
});
</script>
</head>
<body >
<div ng-app="person" ng-controller="personctrl">
<p>
FirstName : <input type="text" ng-model="firstname" >
<div></div>
LastName : <input type="text" ng-model="lastname">
</p></br>
<p>
<input type="submit"value="add" id="btn" ng-click="addusers()">
<h2>{{persons}}</h2>
</p>
</div>
<!-- <form ng-controller="TestController as testCtrl" ng-submit="testCtrl.addText(testCtrl.myText)">
<input type="text" ng-model="testCtrl.myText" value="Lets go">
<button type="submit">Add</button>
<div ng-repeat="item in testCtrl.arrayText">
<span>{{item}}</span>
</div>
</form>-->
<!-- script-->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment