var myapp = angular.module("myapp",[]).config(function($routeProvider){
$routeProvider
//this is the just the login view
.when("/login", {templateUrl:"/app/login/login.html", controller:"loginController"})
//this would devise the help page for the login, notice how the help is placed in a position for the virtual folders
.when("/login/html", {templateUrl:"/app/login/help.html", controller:""})
});
Help doucmentation would be in the same virtual folder as that of the view. Available as the progressive url from the view. Now what we need is a directive that would be manifested on each page so as to move the absolute url.
Here is what the directive might look like
(function () {
var helpPage = angular.module("enggedu").directive("helpPage", function () {
return {
restrict: "E",
replace: true,
templateUrl:"/app/directives/helppage/helppage.html",
scope: {
},
compile:function (tElem, attrs) {
return {
pre: function (scope, element, attributes) {
$(element[0]).popover({
trigger: "hover",
placement: "left",
content:"help me"
})
}
}
},
controller: function ($scope, $location, $window) {
$scope.onHelp = function () {
$window.open($location.absUrl() + "/help");
//$window.location.href='/empstructure/help';//moving to the help page for the emptructure
}
}
}
})
})();
Template could be anything that you wish that appears as a link to the help page of the view. Observe the controller function 'onHelp' - this uses the current absolute location to navigate to the help page.