Let me be crystal clear.
I want to make sure we get this straight and certain from the get-go.
When I say testing the Angular router I don’t mean that we’re actually writing tests for the Angular router.
Instead, here’s what I’m trying to say.
When I say testing the Angular router, I’m talking about testing Angular components, services and other pieces of our Angular application that depend on the Router service given to us by the framework.
The Angular router service gives us the ability to navigate around views as well as URL manipulation capabilities.
It’s a common dependency…
A common cause of bloated Angular applications is unneeded imports.
As an application grows, we developers tend to ignore all the dependencies. And we forget to check our imports to make sure we’re not importing things we don’t use.
So how do we avoid this?
How do we make sure that all unneeded and unused imports are cleaned up?
Visual Code has a handy keyboard shortcut
Alt + Shift + O that you can use to automatically clean up a file.
But say, isn’t there a better way to enforce this?
We can use an option called
Why does testing Angular applications have to be so complicated?
Where do you start when you have to write tests for your Angular application?
What are the first steps?
What should you test?
Not sure how to mock a dependency? Or if you should just inject it directly?
And what Angular testing tools should you use?
What’s Karma anyway?
And how do I use Jasmine?
Or is Mocha better?
Should you test everything? Are unit or integration tests better? What about smock or E2E tests?
Getting started with Angular testing can be overwhelming — it’s hard to know where…
Want to skip the read and get to the code right away? Then click here.
Have you ever noticed…
Maybe your experience with Angular has been different than mine but I find that the HttpClient is a common dependency in an Angular service.
And rightly so.
It’s considered best practice to put your data logic inside a service that can be shared across the application. This leaves the job of displaying or rendering the data to your front-end components. …
How do make sure that your Angular application is always production ready every single time it’s deployed?
What can you do to make sure you never deploy a slow Angular application?
How do use the Lighthouse package with your Angular project to make sure it scores well every single time you deploy?
Let’s start with a story …
…about a booming startup company named LeanTech with an Angular app that served millions of users.
LeanTech had a team of 5 senior developers that knew Angular well. …
angular.json file in the root folder of your Angular project.
Scroll to the
test section and add the
codeCoverage: true line.
Now, when you restart the Angular testing process, you’ll see a new folder in your project called
coverage. This is the code coverage report for your Angular application.
So now that we’ve got our code coverage reports generated, how do we show them?
Well, there’s an extension that will do this for us. It’s called Coverage Gutters.
Go to Extensions…
Need to make your Angular app perform faster RIGHT NOW? Then click here to view and download the complete Angular performance checklist.
Otherwise, if you want to dive deep…
…into all the mechanics and logic of how we improve the performance of an Angular application, then read on.
We’ve got so much to cover and you’re in for a real ride!
Imagine doubling or tripling the performance of your angular application.
What if your Angular application loaded twice as fast?
Or once it had loaded, it performed many times faster than it currently does?
We can even take it a…
Some Angular developers grumble about the jumbled output that appears in the terminal when they test their Angular applications.
They want a nicer report that’s easier to understand at a glance….
Karma Mocha Reporter to the rescue!
Once installed and configured, here’s what the outputs will look like.
How do you do it?
How do you add a login form to your Angular application?
And how do you make sure that users that aren’t logged in automatically see your login page? And the logged-in (authenticated) users see the dashboard or something else?
In this guide, I’m going to show you how to add authentication to your Angular app.
Because I want to make you a better Angular developer.
How would it feel if you could quickly add authentication features to your Angular app? Or whip together a beautiful login form? …
Data models are the backbone of any .NET Core API server.
At least, that’s been my experience.
And building on the data models are the API controllers that give the world access to your data.