src/p4l/static/p4l/js/p4l.js
changeset 33 945b144d68c1
parent 28 f26426e9360b
child 34 cfc090f440d0
equal deleted inserted replaced
32:f625ad551908 33:945b144d68c1
     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: '/'});