equal
deleted
inserted
replaced
1 |
1 |
2 // initialize the app |
2 // initialize the app |
3 |
3 |
4 var app = angular.module("recordApp", ['ngResource']) |
4 var app = angular.module("recordApp", ['ngResource']) |
5 |
5 |
6 app.service("Api", function($resource) { |
6 app.service("Api", function($resource, context) { |
7 this.record = $resource(record_api_url); |
7 this.record = $resource(context.urls.record_api); |
8 }); |
8 }); |
9 |
9 |
10 app.controller("RecordCtrl", function($scope, Api){ |
10 app.controller("RecordCtrl", function($scope, Api, context){ |
11 $scope.record = Api.record.get({recordId: record_id}); |
11 $scope.record = Api.record.get({recordId: context.record_id}); |
12 }); |
12 }); |
13 |
13 |
14 app.config(['$routeProvider', function($routeProvider) { |
14 app.config(['$routeProvider', function($routeProvider) { |
15 // $routeProvider.when('/', {controller: 'RecordCtrl', templateUrl: 'partials/record.html'}); |
15 // $routeProvider.when('/', {controller: 'RecordCtrl', templateUrl: 'partials/record.html'}); |
16 // $routeProvider.otherwise({redirectTo: '/'}); |
16 // $routeProvider.otherwise({redirectTo: '/'}); |