Angular 2: NodeJS vs XAMPP

I'm starting to learn Angular 2, and I'm pretty lost in some subjects ... for example, on the server.

Following the quick install instructions, I installed Node and npm ... when I run the project in Node, everything goes fine. The label is <label>recognized and receives a template for this label (in this case, an html form).

But when I start the same project in MAMP, this label is not recognized and gives the error "Resource loading failed" in the console for the template associated with this shortcut.

So, I assume that Angular 2 is dependent on Node and that there is a problem because I want to download the project later, and I think that my hosting plan does not allow me to run Node ...

I don’t know if I foresee, maybe someone can help me clear this ... Thank you.

+1
source share
3 answers

Angular2 has niether any Relation , not Dependency on node.js.

You can only write an Angular2 application using Angular2 packages without using nodeeither mampor xamppand and host this application.

If you wrote something in a combination of Angular2 and node.js, you can post it on free services such as Heroku for the purpose of testing.

+1
source

Final decision :

Good, wrong again. I'm the scariest detective.

  • TypeScript, JavaScript, " npm" TypeScript JavaScript. "localhost" , index.html, html, , , .php, .

  • , , , "localhost" Node , Apache "localhost" , , @Component: templateUrl: "../template/file.html", "/app/whatever.js", "index.html", templateUrl: "template/file.html", , .

  • , , , Node! ... ...

, , . !

+1

, Zeeshan, , . , Quick Start, , TypeScript JavaScript... "", TypeScript Node JavaScript, :

  • TypeScript Node ( "npm start" ), Apache, Angular ( <whatever></whatever>, <whatever><h1>Hey</h1></whatever>)
  • it works “as always” with JavaScript, without the need for a server, as you told me.

Therefore, I will have to choose between using TypeScript (and all the official documentation!) And host it on some platform, such as Heroku, or work with JavaScript without having to use a specific server so that I can work with Apache.

0
source

Source: https://habr.com/ru/post/1679686/


All Articles