I am currently using the latest angular.beta.0 and have followed their quick start tutorial with the router tutorial.
The app works fine but upon inspecting the generated DOM, there is an <undefined>
tag generated. It isnt causing any issues but I would want it to be clarified.
The undefined tag contains the whole app markup in it.
I am currently using the latest angular.beta.0 and have followed their quick start tutorial with the router tutorial.
The app works fine but upon inspecting the generated DOM, there is an <undefined>
tag generated. It isnt causing any issues but I would want it to be clarified.
The undefined tag contains the whole app markup in it.
Share Improve this question asked Dec 17, 2015 at 9:47 hussainbhussainb 1,2963 gold badges17 silver badges33 bronze badges1 Answer
Reset to default 22When Routing you can skip the selector in the ponents, which is valid. But they will appear as undefined. That may look ugly, so you can avoid it by specifying a selector which will work as a name and won't match any custom element in your templates.
So this will produce an undefined
custom element in your DOM
// Some ponent loaded through routing
@Component({
// No selector!
template : 'Some template'
})
This will not
// Some ponent loaded through routing
@Component({
selector : 'some-ponent',
template : 'Some template'
})
This case will show some-ponent
in the DOM instead of undefined
.
I hope it helps.