angular


This is angular tutorial with version >1

Note : i am using Linux OS,

sample execution(very basic) of angular and npm packages

1. install node.js using command
open the terminal and go to your folder(i have created 'myFolder')

home/venkateswara/myFolder >sudo apt install nodejs

2. after above command we can verify what are versions we have of node/npm.

node -v
npm -v

to test sample
3. create new file called http_client.js and paste following snippet and save

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
4. run the following command to start the server :

...myfolder> node http_server.js

then you will see as

/venkateswara/Applns/myangpractice$ node http_server.js
Server running at http://127.0.0.1:3000/


5. open the broser and hit the url

http://localhost:3000/

output on browser:

Node.js ubuntu install

========================================================================


Chapter 2 : ref : https://www.devglan.com/angular/angular-7-crud-example

installing latest and create proj

To update NPM,  run the following command in the terminal.
npm i npm@latest -g
command to install the latest versions:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli

Generating Angular 7 Project from CLI


Traverse to your folder of choice and execute following commands to generate and run Angular 7 app.
ng new myProj1
cd myProj1
ng serve
server is on starting mode now


then now we can see the index page of angular as below




No comments:

Post a Comment

JAVA NOTES

  click here  👉  Interview  Preparation : complete notes sql queries notes ============================================================ Con...