Guest User

Untitled

a guest
Nov 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html ng-app="">
  3. <head>
  4. <title>Search and print with Scope</title>
  5. </head>
  6. <body>
  7. <div ng-controller="Controller">
  8. <input type="search" ng-model="q" placeholder="CPU" />
  9. <ul>
  10. <li ng-repeat="proc in cpu | filter:q">
  11. {{proc.house}} - {{proc.model}}
  12. </li>
  13. </ul>
  14. </div>
  15. <script src="angular.min.js"></script>
  16. <script>
  17. function Controller($scope)
  18. $scope.cpu = [
  19. { house: 'Intel', model: 'I7' },
  20. { house: 'AMD', model: 'Ryzen' },
  21. { house: 'Qualcomm', modello: 'Snapdragon' }
  22. ];
  23. </script>
  24. </body>
  25. </html>
  26.  
  27. <!DOCTYPE html>
  28. <html ng-app="">
  29. <head>
  30. <title>Search and print with Scope</title>
  31. <script src="angular.min.js"></script>
  32. <script>
  33. var app = angular.module('angularApp',[])
  34.  
  35. app.controller('Controller',function($scope){
  36. $scope.cpu = [
  37. { house: 'Intel', model: 'I7' },
  38. { house: 'AMD', model: 'Ryzen' },
  39. { house: 'Qualcomm', modello: 'Snapdragon' }
  40. ];
  41. });
  42. </script>
  43. </head>
  44. <body ng-app="angularApp">
  45. <div ng-controller="Controller">
  46. <input type="search" ng-model="q" placeholder="CPU" />
  47. <ul>
  48. <li ng-repeat="proc in cpu | filter:q">
  49. {{proc.house}} - {{proc.model}}
  50. </li>
  51. </ul>
  52. </div>
  53. </body>
  54. </html>
  55.  
  56. <!DOCTYPE html>
  57. <html ng-app="myApp">
  58. <head>
  59. <title>Search and print with Scope</title>
  60. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
  61. </script>
  62. </head>
  63. <body>
  64. <div ng-controller="Controller">
  65. <input type="text" ng-model="q" placeholder="CPU" />
  66. <ul>
  67. <li ng-repeat="proc in cpu | filter:q">
  68. {{proc.house}} - {{proc.model}}
  69. </li>
  70. </ul>
  71. </div>
  72. <script>
  73. angular.module('myApp',[]).controller('Controller', function($scope) {
  74. $scope.cpu = [
  75. { house: 'Intel', model: 'I7' },
  76. { house: 'AMD', model: 'Ryzen' },
  77. { house: 'Qualcomm', modello: 'Snapdragon' }
  78. ];
  79. });
  80.  
  81. </script>
  82. </body>
  83. </html>
Add Comment
Please, Sign In to add comment