Most modern React projects are built in webpack. This video teaches you the differences in using the Angular CLI as your build tool, including serving your app locally.
- [Instructor] In this video I'm going to show you how similar it is to run your app in the angular CLI versus running your app in a create react app setup. We've got our react app directory open now to run a react app using create react app. You just use the npm start command which will go ahead and run a script and start you up on your local host 3000. See the browser already started up automatically. It's gone ahead and loaded and it says you can go ahead and edit your source, that app.js to go ahead and reload it.
So let's go ahead and add this text here and save it. And you can see that it went ahead and reloaded that. So that all happens on the fly. It's got hot reloading and react so now we're gonna go into our angular app instead. And instead of using npm start, you're gonna use the ng serve command. The ng serve command will go ahead and compile all of your modules that you've got built and start a live development server in a similar fashion to the one that runs with create react app.
But it doesn't just automatically open your browser so we're gonna go ahead and change this over to our 4200 port and you can see you've got your bootstrapped basic app started up here. And so likewise to the way that we had hot reloading for our react app, there is hot reloading for our angular app as well. So we're gonna go ahead and track down this HTML file here and we're going to add this text as well. And so I've saved that and if you look here you'll see it went ahead and rebuilt everything.
You can see that in your command line here which is kind of helpful because then you know that you've saved and that the rebuild process went ahead and executed and you can see that the hot reload happened and the text that we've added in has come in automatically. Really very similar processes running your app and using the hot reloading feature between react and angular. And that's the essence of running a local server with the angular CLI.
- Comparing ES6 to TypeScript
- Converting and app from React to Angular
- Evaluating the code structure of a React app
- Compilating ahead of time
- Using type guards and advanced types
- Converting components
- Working with controller logic
- Passing data between components
- Creating pipes and directives
- Using services instead of flux
- Using declared routes