Issue 1:
[ X ] feature request

Current behavior

The current error thrown when a service hasn't been defined in a module is:

zone.js:522 Unhandled Promise rejection: No provider for XService! ; Zone: <root> ; Task: Promise.then ; Value:
Error
Error
at Error.ZoneAwareError (http://localhost:3000/polyfills.bundle.js:3588:33)
at ZoneAwareError (http://localhost:3000/polyfills.bundle.js:3585:35)
at injectionError (http://localhost:3000/vendor.bundle.js:3087:86)
at noProviderError (http://localhost:3000/vendor.bundle.js:3125:12)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/vendor.bundle.js:4627:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/vendor.bundle.js:4666:25)
at ReflectiveInjector_._getByKey (http://localhost:3000/vendor.bundle.js:4598:25)
at ReflectiveInjector_.get (http://localhost:3000/vendor.bundle.js:4467:21)
at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:180:107)
at AppModuleInjector.getInternal (ng:///AppModule/module.ngfactory.js:295:53)
at AppModuleInjector.NgModuleInjector.get (http://localhost:3000/vendor.bundle.js:5431:44)
at resolveDep (http://localhost:3000/vendor.bundle.js:12836:45)
at createClass (http://localhost:3000/vendor.bundle.js:12699:91)
at createDirectiveInstance (http://localhost:3000/vendor.bundle.js:12530:37)
at createViewNodes (http://localhost:3000/vendor.bundle.js:13879:49)

Expected behavior

I'd like to know what class the error originated from. What class is trying to inject XService.

What is the motivation / use case for changing the behavior?

When a module has been installed via npm install it becomes annoying to debug. Which NgModule is throwing this error ?

Angular version: 4.0.0

Language: [TypeScript 2 ]

Issue 2:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Current behavior

Actually I have

<span class="slds-form-element__help" *ngIf="form.get('sapNumber').errors?.maxlength" i18n>Maximum de {{max8}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('interfaceAccountNumber').errors?.maxlength" i18n>Maximum de {{max15}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('formDesignation').errors?.maxlength" i18n>Maximum de {{max20}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('shortDesignation').errors?.maxlength" i18n>Maximum de {{max35}} caractères autorisé.</span>

and when I extract with "./node_modules/.bin/ng-xi18n" --i18nFormat=xmb I get 4 times same strings to translate with different ID in my messages.xmb file. All others strings aren't duplicated but this one is, why ?

<msg id="4591664065864994257">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="3596670943450897156">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="27126914192147611">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="8495459888526831686">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>

N.B. I tried with {{15}} interpolation, I tried with max15 : string = "15" I tried with max15 : number = 15 and same behavior !

Expected behavior

Extract only one time this i18n string.

Please tell us about your environment: webstorm 2017.1

Angular version: 4.0.0

Language: [ts 2.2.1]

Node (for AoT issues): node --version = v7.7.2