Answer the question
In order to leave comments, you need to log in
Is a non-SPA application possible with Angular2?
Good day! I decided to slowly start learning Angular2 and immediately a question arose, to which I have not yet found an intelligible answer. The bottom line is this:
In the first version of the framework, it was possible to easily construct non-SPA applications when server routing was fully used and all markup was rendered there. That allowed simply hanging ng-controller="" on the element and using such a controller to fully manipulate the data and already rendered elements.
I don't understand how to repeat this in Angular2. Creating a component necessarily requires a template (-url). Therefore, using a component will inevitably lead to the replacement of the rendered markup, i.e. it will be replaced by a value from the component's template.
What if I want to fully render the markup on the server, if I don't want to dynamically load templates - Angular2 doesn't allow that? :(
Answer the question
In order to leave comments, you need to log in
Well, the second angular without crutches can be rendered on the server.
You can also make a root component with a template <ng-content></ng-content>
and a 'body' selector. Although yes, if you only need a View layer, then you need to take the acc. tool (react, polymer, etc).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question