Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html ng-app>
  3. <head>
  4. <title>Hello World, AngularJS - ViralPatel.net</title>
  5. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
  6.  
  7. <script>
  8. function ContactController($scope)
  9. {
  10. $scope.contacts = ["hi@email.com", "hello@email.com"];
  11.  
  12. $scope.add = function() {
  13. $scope.contacts.push($scope.newcontact);
  14. $scope.newcontact = "";
  15. }
  16. }
  17. </script>
  18.  
  19. </head>
  20. <body>
  21. <div ng-controller="ContactController">
  22. <select ID="select-add-new-product-brand-name">
  23. <option ng-model="selectedItem" ng-repeat="contact in contacts" value={{contact}}>{{ contact|uppercase }}</option>
  24. </select>
  25. </div>
  26.  
  27. <div ng-controller="ContactController">
  28. Email:<input type="text" ng-model="newcontact"/>
  29. <button ng-click="add()">Add</button>
  30.  
  31. <ul>
  32. <li ng-repeat="contact in contacts"> {{ contact }} </li>
  33. </ul>
  34.  
  35. </div>
  36.  
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement