Angularjs: routes and controllers without templateURLs?

后端 未结 3 1645
执念已碎
执念已碎 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 09:06

    use template with empty string.

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

提交回复
热议问题