-
-
Save ibrahim87/052787bb52114407006f to your computer and use it in GitHub Desktop.
This file contains 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
var App = angular.module('App', []); | |
App.controller('TodoCtrl', function($scope, $http) { | |
$http.get('todos.json') | |
.then(function(res){ | |
$scope.todos = res.data; | |
}); | |
}); |
This file contains 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="App" > | |
<head> | |
<meta charset="utf-8"> | |
<title>Todos $http</title> | |
<link rel="stylesheet" href="style.css"> | |
<script>document.write("<base href=\"" + document.location + "\" />");</script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script> | |
<script src="app.js"></script> | |
</head> | |
<body ng-controller="TodoCtrl"> | |
<ul> | |
<li ng-repeat="todo in todos"> | |
{{todo.text}} - <em>{{todo.done}}</em> | |
</li> | |
</ul> | |
</body> | |
</html> |
This file contains 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
[{ "text":"learn angular", "done":true }, | |
{ "text":"build an angular app", "done":false}, | |
{ "text":"something", "done":false }, | |
{ "text":"another todo", "done":true }] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment