0

I used this code as localhost so that's not the problem.

Used pastebin because this editor was breaking my code for about 10 minutes...

main.js -> http://pastebin.com/gePdrETv

index.html -> http://pastebin.com/ehDCyqN6

route2.html -> http://pastebin.com/4s2gtY4j

route1.html -> http://pastebin.com/RDAGQKPv

I am trying to change the view in index.html in ng-view so that I could see different views (/ change views). But it's not working at all (not even a data bind is working, just showing me the {{ message }})

Thanks in advance.

1 Answer 1

1

I think you need to include the following JS as well.

https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.9/angular-route.js

This is for Angular 1.4.9.

The module ngRoute is defined in this separate JS file, so your Angular application can't even bootstrap I think.

Check your console output, I think you'll see an $injector:modulerr there. See the documentation which specifically mentions ngRoute.

Sign up to request clarification or add additional context in comments.

1 Comment

I am getting the error you said, also I implemented the angular-route.js now but still one problem is left being that Angular isn't even detecting that it's an Angular app (data binds are shown as {{ message }} and not as the data behind it). But I think this has something to do with my folder structure so this should be the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.