AngularJS-Service implementiert; Reissorte des Tages wird per http über angular nachgeladen

This commit is contained in:
Sebastian Seedorf
2016-03-29 17:51:00 +02:00
parent cbadac55c5
commit c521f2670b
4 changed files with 21 additions and 0 deletions

View File

@@ -1,4 +1,16 @@
var app = angular.module('myApp', []);
app.controller("indexController", function ($scope, specialService) {
$scope.rice = "Hello World";
specialService.success(function(data) {
$scope.rice = data.rice;
});
});
app.factory("specialService", function ($http) {
return $http.get('/api/specialOffer.json');
});
app.directive('rrMap', function() {
return {
restrict: 'A',