Skip to content
Snippets Groups Projects
Commit 8890eaae authored by Erik Reid's avatar Erik Reid
Browse files

basic angular test

parent 5e6b4616
No related branches found
No related tags found
No related merge requests found
<!doctype html>
<html ng-app="inventoryApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
<script src="inventoryProvider.js"></script>
<link rel="stylesheet" href="todo.css">
</head>
<body>
<h2>Todo</h2>
<div ng-controller="inventoryProvider">
<ul name="routers" class="unstyled">
<li ng-repeat="router in routers">{{router}}</li>
</ul>
</div>
</body>
</html>
\ No newline at end of file
var myApp = angular.module('inventoryApp', []);
myApp.controller('inventoryProvider', function($scope, $http) {
$scope.routers = []
function onSuccess(response) {
$scope.routers = response.data;
}
function onError(response) {
$scope.routers = ['error'];
}
$http({
method: 'GET',
url: 'http://localhost:7878/data/routers'
}).then(onSuccess, onError);
console.log("HERE2");
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment