I thought of using 
'@angular/router-deprecated'; for now in our current project while 
migrating to RC4 from current B 17 . but the application is throwing error. 
it was working fine with beta.
[I am bootstraping  ROUTER_PROVIDERS in main.ts  but it still complains of 
"no provider for router" in another component]

Stack trace:

platform-browser.umd.js:1900 EXCEPTION: Error in ./TriggerComponent2 class 
TriggerComponent2_Host - inline template:0:0
BrowserDomAdapter.logError @ 
platform-browser.umd.js:1900BrowserDomAdapter.logGroup @ 
platform-browser.umd.js:1910ExceptionHandler.call @ 
core.umd.js:4329(anonymous function) @ core.umd.js:9849ZoneDelegate.invoke 
@ [email protected]?main=browser:323onInvoke @ 
core.umd.js:9100ZoneDelegate.invoke @ 
[email protected]?main=browser:322Zone.run @ 
[email protected]?main=browser:216NgZoneImpl.runInner @ 
core.umd.js:9131NgZone.run @ core.umd.js:9360ApplicationRef_.run @ 
core.umd.js:9838ApplicationRef_.bootstrap @ core.umd.js:9860(anonymous 
function) @ core.umd.js:9646p @ es6-shim.js:1867(anonymous function) @ 
es6-shim.js:1880ZoneDelegate.invokeTask @ 
[email protected]?main=browser:356onInvokeTask @ 
core.umd.js:9091ZoneDelegate.invokeTask @ 
[email protected]?main=browser:355Zone.runTask @ 
[email protected]?main=browser:256ZoneTask.invoke @ 
[email protected]?main=browser:423a.exports @ shim.js:1602q.(anonymous 
function) @ shim.js:4306s @ shim.js:4294t @ shim.js:4298
platform-browser.umd.js:1900 ORIGINAL EXCEPTION: No provider for Router!
BrowserDomAdapter.logError @ 
platform-browser.umd.js:1900ExceptionHandler.call @ 
core.umd.js:4338(anonymous function) @ core.umd.js:9849ZoneDelegate.invoke 
@ [email protected]?main=browser:323onInvoke @ 
core.umd.js:9100ZoneDelegate.invoke @ 
[email protected]?main=browser:322Zone.run @ 
[email protected]?main=browser:216NgZoneImpl.runInner @ 
core.umd.js:9131NgZone.run @ core.umd.js:9360ApplicationRef_.run @ 
core.umd.js:9838ApplicationRef_.bootstrap @ core.umd.js:9860(anonymous 
function) @ core.umd.js:9646p @ es6-shim.js:1867(anonymous function) @ 
es6-shim.js:1880ZoneDelegate.invokeTask @ 
[email protected]?main=browser:356onInvokeTask @ 
core.umd.js:9091ZoneDelegate.invokeTask @ 
[email protected]?main=browser:355Zone.runTask @ 
[email protected]?main=browser:256ZoneTask.invoke @ 
[email protected]?main=browser:423a.exports @ shim.js:1602q.(anonymous 
function) @ shim.js:4306s @ shim.js:4294t @ shim.js:4298
platform-browser.umd.js:1900 ORIGINAL STACKTRACE:
BrowserDomAdapter.logError @ 
platform-browser.umd.js:1900ExceptionHandler.call @ 
core.umd.js:4341(anonymous function) @ core.umd.js:9849ZoneDelegate.invoke 
@ [email protected]?main=browser:323onInvoke @ 
core.umd.js:9100ZoneDelegate.invoke @ 
[email protected]?main=browser:322Zone.run @ 
[email protected]?main=browser:216NgZoneImpl.runInner @ 
core.umd.js:9131NgZone.run @ core.umd.js:9360ApplicationRef_.run @ 
core.umd.js:9838ApplicationRef_.bootstrap @ core.umd.js:9860(anonymous 
function) @ core.umd.js:9646p @ es6-shim.js:1867(anonymous function) @ 
es6-shim.js:1880ZoneDelegate.invokeTask @ 
[email protected]?main=browser:356onInvokeTask @ 
core.umd.js:9091ZoneDelegate.invokeTask @ 
[email protected]?main=browser:355Zone.runTask @ 
[email protected]?main=browser:256ZoneTask.invoke @ 
[email protected]?main=browser:423a.exports @ shim.js:1602q.(anonymous 
function) @ shim.js:4306s @ shim.js:4294t @ shim.js:4298
platform-browser.umd.js:1900 Error: DI Exception
    at NoProviderError.BaseException [as constructor] (core.umd.js:4412)
    at NoProviderError.AbstractProviderError [as constructor] 
(core.umd.js:4529)
    at new NoProviderError (core.umd.js:4565)
    at ReflectiveInjector_._throwOrNull (core.umd.js:6461)
    at ReflectiveInjector_._getByKeyDefault (core.umd.js:6489)
    at ReflectiveInjector_._getByKey (core.umd.js:6452)
    at ReflectiveInjector_.get (core.umd.js:6261)
    at DebugAppView._View_TriggerComponent2_Host0.createInternal 
(TriggerComponent2.template.js:76)
    at DebugAppView.AppView.create (core.umd.js:11996)
    at DebugAppView.create (core.umd.js:12207)



Snippet code--

*main.ts*

import *{* bootstrap *}* from '@angular/platform-browser-dynamic';


import *{*HTTP_PROVIDERS*}* from '@angular/http';


import *{* AppComponent *}* from './app.component';


import 'rxjs/add/operator/map';


import *{*AUTH_PROVIDERS*}* from './security/angular2-jwt';


import *{*Auth*}* from './security/auth.service';



import *{*RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS*}* from 
'@angular/router-deprecated';



import *{*TriggerComponent2*}* from './TriggerComponent2';


import *{*TriggerValueComponent*}* from './TriggerValueComponent'





bootstrap(TriggerComponent2,



[HTTP_PROVIDERS,


AUTH_PROVIDERS,


ROUTER_PROVIDERS,


TriggerValueComponent,


]


);



*--TriggerComponent.ts*


import *{*Component, View, CORE_DIRECTIVES, Input*}* from '@angular/core';


import *{* HTTP_PROVIDERS *}* from '@angular/http';


import *{*FORM_DIRECTIVES, FORM_PROVIDERS, FormBuilder, Validators*}* from 
'@angular/common';


import *{*ROUTER_DIRECTIVES, RouteConfig, RouterLink, Location, 
RouteParams, Router, ROUTER_PROVIDERS*}* from '@angular/router-deprecated';


import *{* TriggerService *}* from './TriggerService';


import *{* TriggerRule, ClientID, TriggerValue, TriggerID, CopyInputHolder 
*}* from './TriggerRule';


import *{* TriggerValueComponent *}* from './TriggerValueComponent';


import *{*AuthHttp, tokenNotExpired*}* from './security/angular2-jwt';


import *{*Auth*}* from './security/auth.service';




declare var jQuery: JQueryStatic;




@Component(*{*


selector: 'view-trigger-rule2',



directives: [FORM_DIRECTIVES, RouterLink, ROUTER_DIRECTIVES, 
TriggerValueComponent],


templateUrl: '/TriggerComponentTemplate2.html',


// styleUrls: ['lib/jquery.typeahead.css'] 



providers: [HTTP_PROVIDERS, TriggerService, Auth, ROUTER_PROVIDERS]


*}*)







-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to