nitayneeman / schematics-utilities

🛠️ Useful exported utilities for working with Schematics
https://nitayneeman.github.io/schematics-utilities
MIT License
87 stars 9 forks source link

addProviderToModule bugs with { provide: '', useValue: '' } #8

Open GrandSchtroumpf opened 5 years ago

GrandSchtroumpf commented 5 years ago

When the providers key of NgModule ends with a provider object (like {provide: '', useValue: ''}) the method addProviderToModule has an unexpected result :

@NgModule({
  providers: [
    { provide: '', useValue: '', providers: [{ provide: TOKEN, useValue: 'someValue' }] }
  ]
})

I've run some tests :