I have created a unique directive that allows me to load pages within a specified div element.
.directive('page', function () {
return {
templateUrl: function (elem, attr) {
return 'pages/page-' + attr.num + '.html';
}
};
});
Below is how the custom directive is represented in the DOM:
<div page num="{{pageNo}}"></div>
In this case, I am looking to dynamically change the page number from the controller.
The directive functions correctly when the value is hardcoded like so:
<div page num="1"></div>