Ng build -Prod Angular 2 - How to publish the application

Asked

Viewed 786 times

1

after giving Ng build -Prod it generates files for distribution, my question is the following how can I publish it on a PHP server or any other normal, because when I try to get the files generated by javascript in putting them in another html or php document, does not work, these files work without being on a server?

1 answer

1


When building an angular 2 application the generated files can be used on any web server.

Ex: in Wampserve you can copy the folder /dist from its angular design to the folder /www wampserve and access localhost/dist and there will be your page in angular 2.

Note: the generated files should be used together and not separately because one depends on the other to work.

The best way to work with Angular 2 and PHP is by studying the concepts of SPA (Single Page Application) and Restful API

Browser other questions tagged

You are not signed in. Login or sign up in order to post.