Amitava Karan
Amitava Karan

Reputation: 677

angularjs routing not working properly

I am learning angularjs and created a demo application.

Here is the plunker

In that application I could not make the routing works properly.

When the "/main" route works perfectly but "/user/:username" did not work.

Can anyone please help me out to find the problem?

Thanks

Upvotes: 2

Views: 136

Answers (1)

pgrodrigues
pgrodrigues

Reputation: 2078

You have a typo in "teplateUrl". Changing it to "templateUrl" fixes your issue.

.when("/user/:username", {
    "controller": "UserController",
    "templateUrl": "user.html"
})

Updated fiddle here.

Upvotes: 3

Related Questions