Good day! Decided to start slowly to master Angular2 and immediately had a question that I haven't found a plausible answer. The essence of the following:
In the first version of the framework it was possible to design a non-SPA application, when fully used server-side routing, and the layout renterias there. That allowed just to hang on the element ng-controller="" and using this controller to fully manipulate the data and already rendered by members.
In Angular2 to repeat this do not understand. Creating a component requires a template (url). Therefore, the use of the component will inevitably lead to the replacement of rendered markup, so whatever it is replaced with the value from the component template.
But if I want to fully render the markup on server, when I want to dynamically load templates - Angular2 does not allow it? :(
Possible. With a bunch of crutches and subtle bugs. It is better to take react.
monroe_Windler answered on July 12th 19 at 16:50
Well, the second angular without crutches on the server to render.
You can also do a root component template <ng-content></ng-content> and the selector is 'body'. But Yes, if you need only the View layer, you need to take resp. tool (react, polymer, etc).
pear answered on July 12th 19 at 16:52
why use angular for non-spa?
Sorry can't answer the question, but you must understand, every route you on the new initialisere angular app, why are you doing this?
Totally not the right approach.
There are plenty of other frameworkof for this.