Angularjs: routes and controllers without templateURLs?

后端 未结 3 1669
执念已碎
执念已碎 2021-01-23 08:10

Is it possible to use Angularjs\'s routing and controller without the templateURL?

For instance, below is my current routes, controllers, and template urls,



        
3条回答
  •  天涯浪人
    2021-01-23 08:48

    Setting template with empty string make error and cause recursion loading ; i solved it by just add the link of empty html file.

     return app.config(['$routeProvider', function ($routeProvider) {
        $routeProvider
        .when("/",
        {
           template: "dummy.htm",
           controller: "controller1"
        })
    

提交回复
热议问题