app directive view ViewService function ViewService return restrict li

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
app.directive('view', ['ViewService', function (ViewService) {
return {
restrict: 'E',
link: function (scope, elem, attrs) {
scope.currentUrl = 'views/' + ViewService.currentViewName + '/' + ViewService.currentViewName + '.html';
ViewService.addListener(function () {
scope.currentUrl = 'views/' + ViewService.currentViewName + '/' + ViewService.currentViewName + '.html';
});
},
template: '<div ng-include="currentUrl"></div>'//,
}
}]);