AngularJS-Service implementiert; Reissorte des Tages wird per http über angular nachgeladen
This commit is contained in:
12
public/js/angular-init.js
vendored
12
public/js/angular-init.js
vendored
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user