In angular 1 we could do one time binding in this way: {{ ::myFunction() }}
.
In angular 2 this is throwing:
EXCEPTION: Template parse er
ChangeDetectionStrategy.CheckOnce is the solution for this problem.
This has been updated to OnPush
see also comment in code:
export declare enum ChangeDetectionStrategy {
/**
* `OnPush` means that the change detector's mode will be set to `CheckOnce` during hydration.
*/
OnPush = 0,
/**
* `Default` means that the change detector's mode will be set to `CheckAlways` during hydration.
*/
Default = 1,
}