Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html ng-app="">
- <head>
- <title>Search and print with Scope</title>
- </head>
- <body>
- <div ng-controller="Controller">
- <input type="search" ng-model="q" placeholder="CPU" />
- <ul>
- <li ng-repeat="proc in cpu | filter:q">
- {{proc.house}} - {{proc.model}}
- </li>
- </ul>
- </div>
- <script src="angular.min.js"></script>
- <script>
- function Controller($scope)
- $scope.cpu = [
- { house: 'Intel', model: 'I7' },
- { house: 'AMD', model: 'Ryzen' },
- { house: 'Qualcomm', modello: 'Snapdragon' }
- ];
- </script>
- </body>
- </html>
- <!DOCTYPE html>
- <html ng-app="">
- <head>
- <title>Search and print with Scope</title>
- <script src="angular.min.js"></script>
- <script>
- var app = angular.module('angularApp',[])
- app.controller('Controller',function($scope){
- $scope.cpu = [
- { house: 'Intel', model: 'I7' },
- { house: 'AMD', model: 'Ryzen' },
- { house: 'Qualcomm', modello: 'Snapdragon' }
- ];
- });
- </script>
- </head>
- <body ng-app="angularApp">
- <div ng-controller="Controller">
- <input type="search" ng-model="q" placeholder="CPU" />
- <ul>
- <li ng-repeat="proc in cpu | filter:q">
- {{proc.house}} - {{proc.model}}
- </li>
- </ul>
- </div>
- </body>
- </html>
- <!DOCTYPE html>
- <html ng-app="myApp">
- <head>
- <title>Search and print with Scope</title>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
- </script>
- </head>
- <body>
- <div ng-controller="Controller">
- <input type="text" ng-model="q" placeholder="CPU" />
- <ul>
- <li ng-repeat="proc in cpu | filter:q">
- {{proc.house}} - {{proc.model}}
- </li>
- </ul>
- </div>
- <script>
- angular.module('myApp',[]).controller('Controller', function($scope) {
- $scope.cpu = [
- { house: 'Intel', model: 'I7' },
- { house: 'AMD', model: 'Ryzen' },
- { house: 'Qualcomm', modello: 'Snapdragon' }
- ];
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment