Use Angular 2 in a multiple page website -
how angular 2 quickstart app using angular 2 in website?
my main problem index.html in not in route folder of app. possible have many pages have angular 2 apps?
i realise angular 2 designed spas html component system must useful in sorts of websites.
good page here is angularjs single-page applications (spas)? no actual info on how it.
i use or little angular 2 necessary in different pages across website project.
a sample website using angular 2 in way great.
to answer question (just in case interested), use little typescript load html templates. simple.
public static getfilecontentasync = async (path: string): promise<string> => {                      return await new promise<string>((resolve, reject) =>      {                                             // set xml http request object.         let xhr: xmlhttprequest = new xmlhttprequest();         xhr.open("get", baseurl + path);         xhr.send();          xhr.onload = () =>          {                                            resolve(xhr.response);         };          xhr.onerror = (errorevent: errorevent) =>         {             reject(errorevent);         };     }); }  
Comments
Post a Comment