I'm trying to get my partial to load. This is my present understanding of
how to do it. I think the $http.get statement is the problem -- clicking on
the link to load the partial only results in #/gallery_details being
appended to the URL in the browser.
var app = angular.module("app", ['ngRoute']);
app.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$routeProvider
.when('/gallery_details', {
templateUrl: 'views/gallery_details.html',
controller: 'galleryCtrl' /* Use this controller, below, to
make the view */
}) // no comma here
.otherwise({
redirectTo: '/'
});
// enable html5Mode for pushstate ('#'-less URLs)
$locationProvider.html5Mode(true);
}]);
app.controller('galleryCtrl,' ['$scope', '$http', function($scope,
$http) {
$http.get('views/gallery_details.html').
success(function(data, status, headers, config) {
$scope.message ='<a href="../index.html">Return</a>"';
}).
error(function(data, status, headers, config) {
$scope.message ='ERROR! <a href="../index.html">Return</a>"';
});
}]);
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.