-3

I wish to develop a Web app using PHP as my server-side language and Angular 2 as my MVC framework. When I collecting information about Angular 2, I've seen that it is a good (and recommended) practice to install Node.js and npm first for Angular 2, because it uses Typescript. I have an experience in PHP and Angular JS but not Angular 2. So, my problem is this,

How I run (and compile) Angular 2 Typescript files with my website which has PHP extension, with both node.js and wamp server running?

Or, should I compile Angular 2 files first and them include them to my PHP website? Any help would be highly welcome.

LuckyG
  • 131
  • 2
  • 12
  • _"using PHP as my Client-side language"_ What? PHP is a server side language, it's not designed to run on/as the client. – Epodax Mar 08 '18 at 15:33

2 Answers2

1

You can write Angular2 app just using Angular2 packages without using node or mamp or xampp and host that app.

ref ...https://stackoverflow.com/a/51748693/8625811

Rizwan
  • 3,741
  • 2
  • 25
  • 22
0

The best thing that you can do is that use PHP on the server side as a Webservice and use RESTFUL API in PHP (either uses plain or implement it using CodeIgnitor / Laravel)

And use Angular2 as a Single-page Application, Develop full Front end into the Angular2 and send Requests to the PHP Restful API eg: Login, SignUp, Loading of Data of User Items etc.

So making some little effort learn the Angular2 with NodeJS and TypeScript of course. and Developing Restful API in PHP.

Clientside Frontend: Angular2

Backend Server Side Restful API: PHP (CI/Laravel etc)

Ali Raja
  • 53
  • 2
  • 10