Fireship · @fireship

Angular CLI - The Basics

Uploaded May 14, 2018 · Length 10:50

Angular CLI - The Basics

Summary

Learn how to use the Angular CLI to automate tasks, generate boilerplate code, and speed up development time.

  • angular cli
  • angular development
  • cli automation
  • boilerplate code generation
  • angular tutorial
  • angular basics

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:01

    today I'm starting a new video series

  3. 0:04

    called the basics it will consist of

  4. 0:06

    five to ten videos designed to teach you

  5. 0:08

    the fundamentals of angular six to kick

  6. 0:10

    things off we're going to start with one

  7. 0:12

    of the most powerful features of angular

  8. 0:14

    which is the CLI a ton of new features

  9. 0:16

    were added to the CLI in version 6 and

  10. 0:19

    my goal is to show you how to use it

  11. 0:20

    effectively to dramatically speed up the

  12. 0:22

    development time of your app if you're

  13. 0:24

    new to the channel make sure to LIKE and

  14. 0:25

    subscribe and grab the full source code

  15. 0:27

    from angular firebase comm so the main

  16. 0:30

    goal of angular's command-line interface

  17. 0:32

    is to automate things that you would

  18. 0:34

    otherwise have to do manually and it

  19. 0:36

    does a really good job of that compared

  20. 0:37

    to what other web frameworks offer the

  21. 0:40

    reason I chose it as the topic for this

  22. 0:42

    first basics video is because you really

  23. 0:44

    need to know how to use the CLI before

  24. 0:45

    you can use angular effectively to get

  25. 0:48

    started you want to bring up a command

  26. 0:50

    line terminal which I'm doing here in vs

  27. 0:52

    code then run npm install angular CLI

  28. 0:55

    flag global that should install version

  29. 0:58

    6.0 or greater on your system giving you

  30. 1:00

    access to the ng command you can verify

  31. 1:03

    the install by running an ng flag v

  32. 1:05

    which will print out some information

  33. 1:07

    about your local development environment

  34. 1:09

    then the first command that you'll run

  35. 1:11

    is ng new the new command will generate

  36. 1:14

    all of the boilerplate code that you

  37. 1:16

    need to start a brand new angular

  38. 1:17

    project from scratch you'll go ahead and

  39. 1:19

    say ng new with the name of your app and

  40. 1:22

    then there's a number of different

  41. 1:23

    options that you can pass in with the

  42. 1:25

    command let's say you want to use a CSS

  43. 1:27

    extension you can simply pass in the

  44. 1:29

    style flag along with sass last stylist

  45. 1:32

    or whatever you want to use and if you

  46. 1:35

    want to take advantage of angular's

  47. 1:36

    router you can pass in the routing

  48. 1:38

    option and that will automatically

  49. 1:40

    generate the router for you there's a

  50. 1:42

    bunch of other options which you can

  51. 1:43

    check out on the documentation on github

  52. 1:46

    but I use these two options very

  53. 1:48

    frequently when you execute this command

  54. 1:50

    it's going to generate a new directory

  55. 1:52

    based on the name of your app then it

  56. 1:54

    creates all the files necessary to build

  57. 1:56

    and test an angular app now that we've

  58. 1:59

    created this directory we'll go ahead