Angular First App

Here are the steps to create your first Angular app

  1. Open a command prompt or terminal window and navigate to the directory where you want to create your Angular app.
  2. Open a command prompt or terminal window and navigate to the directory where you want to create your Angular app.
  3. ng new my-angular-app

    Note: Replace "my-angular-app" with the name of your project.

  4. Change into the project directory by running the following command:
  5. cd my-angular-app
  6. Start the development server by running the following command:
  7. ng serve --open

    Note: The "--open" flag will automatically open your default web browser and navigate to http://localhost:4200, which is where your Angular application will be running.

  8. Open your code editor and navigate to the "src/app" directory.
  9. Open the "app.component.html" file and replace the existing code with the following
  10. Welcome to my first Angular app!

  11. Save the changes to the file and go back to your web browser. You should now see the message "Welcome to my first Angular app!" displayed in your web browser.

That's it! You have now created and run your first Angular app. You can continue to modify the files in the "src/app" directory to build more complex applications.

Next Article ❯