angularjs - provide is not defined -


my angularjs2 gives me angular2-polyfills.js:138 error: provide not defined main.ts. codes is:

import {bootstrap}    'angular2/platform/browser'; import {appcomponent} './app'; import {router_providers,router_directives} 'angular2/router'; import {platform_directives} 'angular2/core';   bootstrap(appcomponent, [provide(platform_directives, {usevalue: [router_directives], multi:true})]); 

anyone has idea?

update

in angular2 rc.4 , later provide deprecated. use object literal syntax instead:

bootstrap(appcomponent, [{provide: someservice, useclass: someotherservice}])    @component({   providers: [{provide: someservice, useclass: someotherservice}],    ... }) 

original

you need import it. it's exported angular2/core:

import {platform_directives, provide} 'angular2/core'; 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -