(function() {
angular
- .module('entities', ['ui', 'model'])
+ .module('entities', ['ngSanitize', 'ui', 'model'])
+
+ .controller('EntityCtrl', ['Model', '$routeParams', '$scope', '$sce', function(Model, $routeParams, $scope, $sce) {
+ $scope.entityId = $routeParams.id;
- .controller('EntityCtrl', ['Model', '$routeParams', '$scope', function(Model, $routeParams, $scope) {
this.loadEntityLinearization = function() {
Model.loadEntityLinearization($routeParams.id,
function(data) {
});
};
+ this.loadEntityGraph = function(e) {
+ Model.loadEntityGraph($routeParams.id,
+ function(data) {
+ $scope.graph = $sce.trustAsHtml(data);
+ }, function(err) {
+ $scope.error = err;
+ });
+ };
+
Model.loadEntity($routeParams.id,
function(data) {
$scope.mentity = data;
- }, function(err) {
- $scope.error = err;
+ }, function(message, status) {
+ $scope.error = {message: message, status: status};
});
}])
};
})
+ .directive('entityNamespace', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ mentity: '='
+ },
+ templateUrl: '/directives/entity/namespace.html'
+ };
+ })
+
.directive('entityTag', function() {
return {
restrict: 'E',