Angular 2 with PHP backend design structure thoughts : <p>I have a huge project, which has grown over the years. I would like to change, change not refactor, from jQuery to Angular 2 in the frontend (this is not a question on refactor jQhery to Angular, which has been discussed a lot here. Also, I think it's not compareable).</p>

<p>Ok, first of all Angular 2 does not have controllers anymore in the meaning of AngularJS. So, we got only compontents. I think it would be the best way, to divide the page into header, content and footer components.</p>

<p>With the change to Angular 2 I would also change my backend to the Twig Rendering Engine. That wouldn't be a problem, because we can change the symbol of Twig e. g. from <code>{{</code> to <code>&lt;%</code> and <code>}}</code> to <code>%&gt;</code>. To clearify if it should be rendered on the frontend or the backend.</p>

<p>My question is: What is better? Rendering on the client / frontend or the backend? I Could use Twig (with an output buffer) for the main part and could it send back to the client via JSON, e. g.:</p>

<pre><code>{
header: {
   error: false
},
view: // html escaped content here
}
</code></pre>

<p>In this way, I could get the data from the database and put it prerendered all together, which may contain directives which are rendered at the frontend.</p>

<p>On the other hand, I could use some static template partials (for loops etc.), which just set their values returned from JSON into that Angular 2 HTML Template. On that way, I would have huge rendering on client side. So, what are the thoughts of Angular 2 about that? I mean, I am not sure, if this is really a good thing for mobile clients like mobile phones or other thin clients. I am creating an responsive template, so I have to look after that criteria.</p>

<p>What do you think, what is better or how are you dealing with that?</p>
