bogumbiker
bogumbiker

Reputation: 527

Angular2 app only as a part of the page

Is it possible to write and deploy Angular2 app within existing page as a small component? The idea is that most of the page is generated by PHP but main content would like to replace by Angular app for better Ux and Ui.

For example:

<!doctype html>
<html lang="en">
<head>
....
</head>
 <body>
   <some_header>....</some_header>

    <app-angular>
    </app-angular>

  <some_footer>....</some_footer>
</body>
</html>

What are the limitations?

Upvotes: 2

Views: 229

Answers (2)

Yakov Fain
Yakov Fain

Reputation: 12376

This should be available with the help of Angular Elements (see http://nitayneeman.com/posts/a-practical-guide-to-angular-elements/), which will allow you to create a custom web component, which can be placed into any HTML page. I really hope that it'll be released with the upcoming Angular 6.

Upvotes: 2

bigwolk
bigwolk

Reputation: 418

Angular is a framework - it's designed for creating single page applications from scratch. For existing applications better will be React - a library very similar to Angular - You shouldn't have problems with it.

Upvotes: 2

Related Questions