I looked at this source code: https://github.com/angular/angular.io/blob/master/public/docs/_examples/toh-5/dart/lib/app_component.dart
and it seems that my application will be routed right now when I go to the root.
local: 8080 /
Updating routes when I move my application, but it seems that if I am in something: localhost:8080/dashboard in basecase and doing a hard update, it fails. This will give me a 404 not found! error 404 not found! .
It will only work if I do: localhost:8080/#!/dashboard , but this is not the address passed to my application.
In index.html, I have: <base href="/">
My App_Component.dart file looks like this:
import 'package:angular2/angular2.dart'; import 'package:angular2/router.dart'; import 'hero_component.dart'; import 'heroes_component.dart'; import 'dashboard_component.dart'; import 'hero_service.dart'; @Component( selector: "my-app", directives: const [ROUTER_DIRECTIVES], providers: const [HeroService, ROUTER_PROVIDERS], templateUrl: "app_component.html") @RouteConfig(const [ const Route( path: "/dashboard", name: "Dashboard", component: DashboardComponent, useAsDefault: true), const Route( path: "/detail/:id", name: "HeroDetail", component: HeroDetailComponent), const Route(path: "/heroes", name: "Heroes", component: HeroesComponent) ]) class AppComponent { String title = "Tour of Heroes"; }
I seem to have a routing that works for everything but this.
My final state will do: localhost: 8080 / detail / 14, and it will open the correct component. This is something that is not done now on the new site link, as well as when navigating throughout the application.