質問

I'm new to Angularjs and have been learning about routing.

I created a test application for routing but somehow it doesn't works!

I have thoroughly checked all the official documentation and tried different combinations but not been able to make it work yet

Here is the code: http://plnkr.co/edit/msjFJfKPq5xm588RJjNP

someone please help!

Thanks in advance

役に立ちましたか?

解決

Change

var app = angular.module('app', ['ngRoute'] );

to

var app = angular.module('app');

in your controllers and everything will be fine

By adding second argument to the module function you register new module.

Updated your plunk

Update

About contact view. There is another typo:

templateURL: 'contact.html'

and should be:

templateUrl: 'contact.html'

Plunk updated.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top