Your route definition should start with a /
.when('/views/gallery_details' ...
instead of
.when('views/gallery_details' ...
On Thursday, February 5, 2015 at 10:01:36 AM UTC-6, Steve Husting wrote:
>
> Well, I have the following in index.html:
>
> <a href="#views/gallery_details"> Details</a>
>
> ... which I assume will connect to the above code via <script
> src="angular/galleryApp.js"></script> and still views/gallery_details.html
> does not come on when the link is clicked. There are no errors or warnings
> in Dev Tools. All of my research indicates that these two codes are
> correct, so I'm trying to figure out why the link does not change pages.
>
> [ In the original post, "view/" should be "views/." This was corrected and
> still does not work. ]
>
> Thanks for looking!
>
>
> On Wednesday, February 4, 2015 at 6:30:51 PM UTC-8, Nicholas Smith wrote:
>>
>> Looks right to me, but won't know until you try to run it.
>>
>> On Wednesday, February 4, 2015 at 5:07:45 PM UTC-6, Steve Husting wrote:
>>>
>>> var app = angular.module("app", ['ngRoute']); // Our module
>>>
>>> // The following service provider $routeProvider will define the routes
>>> of our app
>>> app.config(['$routeProvider', function($routeProvider) {
>>> $routeProvider
>>> .when('view/gallery_details', { // This URL, in index.html, will
>>> map to the following view
>>> templateUrl: 'views/gallery_details.html'
>>> }) // no comma here
>>> .otherwise({
>>> templateUrl: 'index.html'
>>> });
>>> }]);
>>>
>>> Thanks!
>>>
>>
--
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.