diff --git a/inventory_provider/static/demo.html b/inventory_provider/static/demo.html new file mode 100644 index 0000000000000000000000000000000000000000..369df4fc8bb3003605f4107f00b54eb5e0a80d93 --- /dev/null +++ b/inventory_provider/static/demo.html @@ -0,0 +1,16 @@ +<!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 diff --git a/inventory_provider/static/inventoryProvider.js b/inventory_provider/static/inventoryProvider.js new file mode 100644 index 0000000000000000000000000000000000000000..df3ec25aea9ffafc74c1b0f405c4755d61353aaa --- /dev/null +++ b/inventory_provider/static/inventoryProvider.js @@ -0,0 +1,20 @@ +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