src/p4l/static/p4l/js/p4l.js
author ymh <ymh.work@gmail.com>
Wed, 04 Sep 2013 10:46:53 +0200
changeset 28 f26426e9360b
parent 26 a0e152dd1fad
child 33 945b144d68c1
permissions -rw-r--r--
update view simplification. Baby step towards complete form.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
// initialize the app
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
var app = angular.module("recordApp", ['ngResource'])
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
app.service("Api", function($resource) {
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    this.record = $resource(record_api_url);
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
});
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
app.controller("RecordCtrl", function($scope, Api){
28
f26426e9360b update view simplification. Baby step towards complete form.
ymh <ymh.work@gmail.com>
parents: 26
diff changeset
    11
    $scope.record = Api.record.get({recordId: record_id});
26
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
});
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
app.config(['$routeProvider', function($routeProvider) {
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
//    $routeProvider.when('/', {controller: 'RecordCtrl', templateUrl: 'partials/record.html'});
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
//    $routeProvider.otherwise({redirectTo: '/'});
a0e152dd1fad first version of angular intégration
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
  }]);
28
f26426e9360b update view simplification. Baby step towards complete form.
ymh <ymh.work@gmail.com>
parents: 26
diff changeset
    18