nitweb/angular: add /package/:full_name page
[nit.git] / share / nitweb / javascripts / entities.js
index a2854aa..4fe181b 100644 (file)
 
 (function() {
        angular
-               .module('entities', ['model', 'ui'])
+               .module('entities', ['model'])
+
+               .controller('EntityCtrl', ['Model', '$routeParams', '$scope', function(Model, $routeParams, $scope) {
+                       Model.loadEntity($routeParams.id,
+                               function(data) {
+                                       $scope.mentity = data;
+                               }, function(err) {
+                                       $scope.error = err;
+                               });
+               }])
 
                .directive('entityLink', function() {
                        return {
                                templateUrl: '/directives/entity/link.html'
                        };
                })
+
+               .directive('entityDoc', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '='
+                               },
+                               templateUrl: '/directives/entity/doc.html'
+                       };
+               })
+
+               .directive('entitySignature', function() {
+                       return {
+                               restrict: 'E',
+                               scope: {
+                                       mentity: '='
+                               },
+                               templateUrl: '/directives/entity/signature.html'
+                       };
+               })
 })();