-1

We have an existing website, it's written on Flask Jinja and we want to move to Angular 2+. The problem is this that site is currently used and it's under development too, and if we want to add or change something in old site, we will have to do it twice in the existing version and in the new version with Angular 2+. Is there a way to partially add angular for some pages in an existing project? Something like this with React.js https://reactjs.org/docs/add-react-to-a-website.html#optional-try-react-with-jsx

Yuriy
  • 367
  • 2
  • 6
  • 17
  • Does this answer your question? [Is it possible to use AngularJS with the Jinja2 template engine?](https://stackoverflow.com/questions/30362950/is-it-possible-to-use-angularjs-with-the-jinja2-template-engine) – Justinas Mar 29 '21 at 11:31
  • Unfortunately no, becouse it's for AngularJS, I need to do it with Angular 2+ . – Yuriy Mar 29 '21 at 11:33

1 Answers1

1

I havn't had any experience using Flask Jinja, but it seems like it's just a server-side template engine.

That wouldn't prevent you from placing a Angular app on a template. You should to able to create an angular app, and then bootstrapping the custom <app-root>-element in the template. I would just create a sample Angular app, build it and take the contents of the index.html-page (in the dist-folder) and incorporate it into a Flask Jinja template.

You may face issues if using the Angular router, since you wouldn't be making a SPA - but stearing clear of that, you'd be fine.

Anders
  • 660
  • 3
  • 12