Hello
I have an app that renders an HTML page, which contains an angular2
application built with webpack:
<!doctype html><html><body> <my-app>Loading...</my-app> <script
src="/web/build/bundle_app.js"></script></body></html>
>
>
I would like to pass some configuration from the server to the app when
this HTML is generated. Some of the configuration may be static (e.g. an
API URL), some may be dynamic (e.g. session token).
In Angular 1.x I could define a provider in HTML and embed that config as a
JSON object, e.g. app.factory("config", function() { return ...; });
How do I achieve the same in Angular 2? I've found some examples using
SystemJS, but I'm not using that. I can't find any others.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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.