Dynamic hostname and aot

I want to bind a dynamic class name on a component node with the syntax like this:

@Component({
  host: {
    [`[class.${classNames()}]`]: 'true', 
  },
  selector: '...',
  templateUrl: '...',
})

      

When I try to build with angular-cli in AOT mode I have this error:

Error in error. Expression not supported

How can I get it to work?

thank

+3
angular angular-cli angular-aot


source to share


No one has answered this question yet

Check out similar questions:

175
How can I use / create a dynamic template to compile a dynamic component with Angular 2.0?
8
angular cli AOT compilation error
five
Is AOT compilation the default on angular @ 4.0.0?
2
ERROR in Error encountered character value statically resolving. The calling function 'ɵmakeDecorator'
2
Angular Aot Error - How to replace a function with a reference to an exported function
1
How can I create "dynamic" AOT modules? (An error occurred when detecting character value values ​​statically. Function calls are not supported.)
1
AOT - function calls are not supported
1
Angular-2 dynamic component, AOT time error
0
Compile time static analysis error ahead
0
Angular2 - AOT - dynamic component provider definition



All Articles
Loading...
X
Show
Funny
Dev
Pics