Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CONST_EXPR in Angular2 RC.0

Tags:

angular

I was using CONST_EXPR in beta releases via;

import {CONST_EXPR} from 'angular/src/facade/lang';

But this is not working with Angular2 RC.0, is there way to import it from somewhere or is there a viable replacement. I was using it to integrate with ngModel in my input components to create a value accessor e.g.

const INPUTSWITCH_VALUE_ACCESSOR: Provider = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {
    useExisting: forwardRef(() => InputSwitch),
    multi: true
}));
like image 705
Cagatay Civici Avatar asked May 03 '16 17:05

Cagatay Civici


1 Answers

I think CONST_EXPR was just a wrapper for required translation of const for ts2dart. It seems they got rid of this recently. There is no need to make this const in TypeScript.

See also https://github.com/angular/angular/pull/8227/files

like image 74
Günter Zöchbauer Avatar answered Nov 20 '22 04:11

Günter Zöchbauer