I am trying to build a page with a static header and footer layout, but using ng-view or ng-include to change my container template based on the URL. I've tried two methods:
Using $routeProvider:
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/', {
template: 'views/home.html',
controller: 'Ctrl',
});
$routeProvider.when('/contact-us', {
template: 'views/contact.html',
controller: 'Ctrl',
});
$routeProvider.otherwise({
redirectTo: '/'
});
}]);
or a controller function to return a template URL:
app.controller('locationCtrl', function ($scope, $location, $routeParams) {
$scope.templateUrl = function() {
return "/views/home.html";
}
});
However, with either one I get am unable to get a contact-us error message.