- Different people learn in different ways.
Personally, I learn better by doing than by watching.
So in this chapter, we're going to write some code together.
I'll do my best to show you each step along the way
because I want you to follow along with me.
If you get stuck,
please reach out to me on Twitter so I can help
because I think you're going to be much more confident
using RxJS if you're able to complete these exercises.
We'll also a repo with the course exercises
which will be kept updated.
I'm using Angular because it's what I'm familiar with,
but I've tried to structure this course in such a way
that it will be helpful for any JavaScript developer.
So even if you're a fan of React or Vue rather than Angular,
that should be okay.
First, we're going to use the awesome Angular
command line interface to create a super-simple Angular app.
Now we didn't always have this CLI
and I have to tell you,
it makes life so much easier
that it almost feels like cheating
because it's so fast and easy to create a working app.
If you love this as much as I do
I hope you'll send a shout-out
to Mike Brocchi and Hans Larsen
because they've created this for us.
And they're super nice guys.
But I digress.
If you don't already have the Angular CLI installed
you can use
npm install -g @angular/cli.
But if you're doing that -g,
which is the global flag,
you're going to want to go back to the beginning
and add sudo
which will install this as an administrator.
If you don't do that,
you're probably going to get an error message.
We're going to do sudo.
It's going to ask for a password
We're going to type in that password
and then it should install the CLI.
If you have any trouble or questions about the CLI,
you can visit cli.angular.io
and you'll find lots more info.
You can also search our video library for Angular CLI
and you'll find other videos with more detail about this.
Because we've covered this extensively in other courses,
we're going to assume that you got this working,
and we're going to keep moving.
We're going to navigate to the directory we'll be using,
which for this will be cd Documents/Projects.
Then we're going to use the Angular CLI
by typing in ng new and the name of our project.
For this I'm going to name our project rxjs.
Okay.
So I got this popup.
The 'git' command requires the command line developer tools.
We don't need this for this course,
so I'm just going to go ahead and click on, Not Now.
Now I need to cd into rxjs
which is the directory that was just created
and then I can do ng serve.
Okay.
Now you should see a message that says
there is a Live Development Server
listening on locahost:4200.
What we want to do is go ahead and jump over to
localhost 4200.
Look at that.
It works.
That is so awesome.
You should also be able to find the project you just created
and open it in a code editor.
We're going to go over to VS Code
and we're just going to take a quick look at this.
In Code, we're going to open
Documents,
Projects,
rxjs.