I was surprise to know if parameters as string type and I cannot use string 
variables in angular 2

let myrouter =  new AsyncRoute({ path: "/PAGE1", name: "PAGE1",   loader: 
() => System.import("app/screens/PAGE1").then(c => c["PAGE1"]) });
 this.routes.push(myouter);

above will work but in my project , I have 2,000 routers so I go as below 
and doesn't work because of string variable!!

let screen :string;
for(var i: number=0; i< 2000; i++){
  screen = screens[i];
 console.log("screen=" + screen); //ok as : screen=PAGE1
  let myrouter =  new AsyncRoute({ path: "/" + screen, name: screen,   
loader: () => System.import("app/screens/"+ screen).then(c => c[screen]) });
 this.routes.push(myouter);
}

-- 
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