0

I have an angular 2 app (built with Angular RC1) that is using the class RouteConfig from the router-deprecated module of RC1.

import {Component} from "@angular/core";
import {RouteConfig, RouterOutlet} from "@angular/router-deprecated";
import {LoginComponent} from "./login/login";

@RouteConfig([
  {path: "/", redirectTo: ["Login"]},
  {
    path: "/login",
    component: LoginComponent,
    name: "Login"
 }])
@Component({
  selector: "my-app",
  template: "<router-outlet></router-outlet>",
  directives: [RouterOutlet]
})
export class AppComponent {
}

As seen above, when the user hits localhost:3000 on the browser, I am seeing the browser url redirect to:

http://localhost:3000/%E2%80%9C/%E2%80%9C/%E2%80%9C/login

I am seeing a related issue with Component decorator templateUrls. Here's my other stackoverflow post

I must be missing or doing something wrong here. Any ideas?

I suspect it might have to do with the config SystemJS?

Community
  • 1
  • 1
freddy mercury
  • 608
  • 1
  • 7
  • 19

2 Answers2

0

The resolution was that the

<base href="/">

tag was using a stylized character encoding for the double quotes. I (shamefully) admit that I must have copied the tag from a tutorial and did not sanitize the double quote character; lesson learned.

freddy mercury
  • 608
  • 1
  • 7
  • 19
0

According to this post, I think the fix is to change 'RouteConfig' to 'Routes' and remove the 'name' property from any route definitions placed in that array.

billdwhite
  • 59
  • 1
  • 6