Skip to content

Instantly share code, notes, and snippets.

@akkunchoi
Last active December 30, 2015 06:28
Show Gist options
  • Select an option

  • Save akkunchoi/7789221 to your computer and use it in GitHub Desktop.

Select an option

Save akkunchoi/7789221 to your computer and use it in GitHub Desktop.
angular test

Angular sample code

<!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