Add Custom Data Types with TypeScript Interfaces in Angular

InstructorSam Julien

Share this video with your friends

Send Tweet

Right now, our app is just using the generic any type for our habits. The any type basically tells TypeScript to leave us alone and not bother us. This gets our app to work, but it's kind of riding a bike with a deflated back wheel. Angular really shines when you can take advantage of the power of TypeScript. Let's add a custom type for habits using an interface. Then, we'll use it in the habit service and the list and item components.

Sam Julieninstructor
~ 5 years ago

To get the Intellisense in your templates, you'll need to install the Angular Language Service in your editor -- it's awesome! 🎉

Alfonso Rush
~ a year ago

following the typeScript recommendations from the linter "somehow" fixed what was broken from before.