.module('entities', ['ngSanitize', 'ui', 'model'])
.controller('EntityCtrl', ['Model', '$routeParams', '$scope', '$sce', function(Model, $routeParams, $scope, $sce) {
+ $scope.entityId = $routeParams.id;
+
this.loadEntityLinearization = function() {
Model.loadEntityLinearization($routeParams.id,
function(data) {
Model.loadEntity($routeParams.id,
function(data) {
$scope.mentity = data;
- }, function(err) {
- $scope.error = err;
+ }, function(message, status) {
+ $scope.error = {message: message, status: status};
});
}])
<div class='container-fluid'>
+
+ <div ng-if='error' class='alert alert-danger' role='alert'>
+ <span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>
+ <span class='sr-only'>Error:</span>
+ <span ng-switch='error.status'>
+ <span ng-switch-when='404'>Entity <code>{{entityId}}</code> not found!</span>
+ <span ng-switch-default>An error occured<br/>{{error.status}}: {{error.message}}</span>
+ </span>
+ </div>
+
<div class='page-header'>
<h2><entity-signature mentity='mentity' /></h2>
<entity-namespace mentity='mentity' />