You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I may have found a use case where it's a valid to execute a route that doesn't have an associated template. Imagine a page that launches various modal windows with the requirement to be able to deep-link directly to the page with a dialog open.
The only difference between the modals are the title & text, so the $rootScope is responsible for setting up and launching a modal, and the controller simply provides route specific content.
A workaround is to set { controller: 'fooCtl', template: ' ' }, but it'd be nice to leave the template property out altogether.
well that's messed up and worth investigating, but setting templateUrl to false doesn't accomplish what you want, so why are you doing that? It doesn't mean anything as far as angular is concerned
Maybe, but sometimes I need angular route doesn't load by default an template. Because I can load manually my custom template and compile it on the fly.
in particular, setting templateUrl to false will try to resolve the string "false" as a URL, which should be resolved relative to the current location of the frame (which is almost certainly not what you want)
The problem with having an empty or false templateUrl is tracked here: #12176
Since you can do template: '', it's very easy to have a route "without" a template
Activity
joseluisq commentedon May 8, 2015
For example when
templateUrlisfalse:Angular loads all controllers again and then the console throws this:
Finally the browser tab is frozen.
caitp commentedon May 8, 2015
well that's messed up and worth investigating, but setting
templateUrlto false doesn't accomplish what you want, so why are you doing that? It doesn't mean anything as far as angular is concernedjoseluisq commentedon May 8, 2015
Maybe, but sometimes I need angular route doesn't load by default an template. Because I can load manually my custom template and compile it on the fly.
caitp commentedon May 8, 2015
Right, but you could just use
template: ""to achieve that.caitp commentedon May 8, 2015
in particular, setting
templateUrlto false will try to resolve the string "false" as a URL, which should be resolved relative to the current location of the frame (which is almost certainly not what you want)joseluisq commentedon May 8, 2015
In general I think it should exist a validation for templateUrl.
Thanks, I will try this
Narretz commentedon Nov 3, 2016
The problem with having an empty or false templateUrl is tracked here: #12176
Since you can do template: '', it's very easy to have a route "without" a template