I am currently developing an App with Anuglar 2 and am trying to have it
route to my homepage when the app is started.
I have a main.html and a main.ts file that are loaded on their own and have
various nested views (if that is the right name for those) that can be
loaded in, home is one of them.
The code at this point looks something like this:
import {[...], Router} from 'angular2/router';
[...]
@Component({
selector: 'main',
bindings: [Router]
})
@View({
directives: [[...] Router],
templateUrl: '[...]/main.html'
})
export class mainApp {
private router;
constructor(router: Router)
{
router.navigateByUrl('/home');
}
}
bootstrap(mainApp, [[...}, Router]);
[...] indicates some other code that should not matter for the issue itself.
Now with the code present, starting the App tosses the following error:
Cannot resolve all parameters for function Router(registry, parent,
hostComponent) {(?, ?, ?). Make sure they all have valid type or
annotations.
How can I fix it and get the routing/auto-navigation to work?
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.