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

1

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

    
asked by anonymous 17.01.2017 / 12:49

1 answer

1

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

Ex: In Wampserve you can copy the /dist folder of your angled project to the /www folder of wampserve and access localhost/dist and there your angular page will be 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 to study the concepts of SPA (Single Page Application) and RESTful API

    
27.01.2017 / 18:54