ANGULARJS 2 (TYPESCRIPT) + WORDPRESS

How can i integrate Angularjs2 App (TypeScript) in Wordpress Theme (Pages).

In version Angularjs 1 its easy cause we dont compile so we can use JS and HTML direct into wordpress pages

Since Ang2 is using Typescript and AOT for compilation how can we integrate SPA app in Ang2 into wordpress? And i dont want to use Angular Wordpress Themes, we have another theme to use.

Thanks in advance.

Upvotes: 1

Views: 324

Answers (1)

Alvin Saldanha
Alvin Saldanha

Reputation: 916

You might want to explore the new Angular 6 elements features to accomplish this.

Install Angular CLI 6 and initialize the project

npm i -g @angular/cli
ng new wordpressWebComponent --prefix custom

Add the elements

ng add @angular/elements

Create the component and build using ng build and you should have html and java script similar to what angularJS produces. Once you have the HTML and .js files its similar to what you did with AngularJS

Upvotes: 3

Related Questions