I am using this method on app.component to load the JQuery of the theme
that I am using:
```
ngAfterViewInit() {
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "../assets/js/pages.js";
this._elementRef.nativeElement.appendChild(s);
}
```
but after login the JQuery transitions only works when I refresh the
browser.
I have implemented Angular2TokenService for handle authentication on
frontend side
```
onSubmit(signInData: SignInData, isValid: boolean) {
this.submitted = true;
this._tokenService.signIn(signInData).subscribe(
res => {
this.unauthorized = false;
this._router.navigate(['/partner']);
}, error => {
this.unauthorized = true;
}
);
}
```
when I remove canActive, the JQuery is loaded:
```
const appRoutes: Routes = [
{
path: '',
redirectTo: '/login',
pathMatch: 'full'
},
{
path: 'login',
component: LoginComponent
},
{
path: 'partner',
loadChildren: 'app/dashboard/dashboard.module#DashboardModule',
// canActivate: [Angular2TokenService]
}
]
```
some idea about what is happening?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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.