I was looking for ways to load styles conditionally in a component. While I was doing that I try'ed the following:
@Component({
selector:console.log('test',this)||'login-with-password', //logs: undefined
templateUrl:'./login-with-password.html',
styleUrls:['./login-with-password.css'],
preserveWhitespaces:false
})
For my surprise this was logged as undefined. I was wandering how can this be, since the this keyword should always point to something, ether window or null.
In what context does the decorator run that its context is undefined?