Angular sample code
Last active
December 30, 2015 06:28
-
-
Save akkunchoi/7789221 to your computer and use it in GitHub Desktop.
angular test
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 ng-app> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script> | |
| </head> | |
| <body> | |
| <div> | |
| <label>Name:</label> | |
| <input type="text" ng-model="yourName" placeholder="Enter a name here"> | |
| <hr> | |
| <h1>Hello {{yourName}}!</h1> | |
| </div> | |
| <div ng-controller="HogeCtrl"> | |
| <ul> | |
| <li ng-repeat="phone in phones"> | |
| {{phone.name}} | |
| <p>{{phone.snippet}}</p> | |
| </li> | |
| </ul> | |
| </div> | |
| <script> | |
| function HogeCtrl($scope){ | |
| $scope.phones = [ | |
| {name: 'p1', snippet: "hogehoge moge"}, | |
| {name: 'p2', snippet: "hogehoge moge"}, | |
| {name: 'p3', snippet: "hogehoge moge"} | |
| ]; | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment