gmostert / ng2-breadcrumb

This is an angular 2 component that creates a breadcrumb trail. It hooks into the angular2/router, to dynamically build up the crumb trail once a component is routed to.
MIT License
102 stars 81 forks source link

Iss81 - Fixed strictNullChecks TS option incompatibility #90

Open pascallaprade opened 6 years ago

pascallaprade commented 6 years ago

This aims to close issue #81.

Since Angular 4+ (which this library targets), the strictNullChecks TypeScript compiler option is officially supported by the Angular project.

This means that users wishing to enforce stricter compiler rules for their projects should be able to do so.

However, this library did not support that option, because one of the variable was incorrectly typed.

This pull request brings official support for this option, just like the Angular project itself, by adding that option to its compiler options. It also fixes the faulty line that did not pass that check.

pascallaprade commented 6 years ago

I updated the pull request by resolving issue #91 as well, since they were related, and since a fix for #91 would need the previous fix in order to be implemented.

Only one part of the code didn't compile under strict rules, and it was once again only a wrong type that was previously ignored by TypeScript, so I thought the change was small enough to be included in this request.