1. Angular 2 release candidate

Right on time for ngconf, Angular is now out of beta and the first release candidate has been published. This version includes a couple of breaking changes in terms of packaging. There’s another release candidate that fixes a couple of bugs in the first release candidate. Check out the full changelog here.

2. Map literals as providers

If you’ve read our article about DI in Angular 2, you know that we can configure injectors using providers like this:

@Component({
  ...
  providers: [
    provide(MyService, {useClass: OtherService})
  ]
})
class MyCmp {}

We can now use map literals to create providers which saves us a couple of keystrokes:

@Component({
  ...
  providers: [
    { provide: MyService, useClass: MyService }
  ]
})
class MyCmp {}

3. Testing support for routing

Angular 2 now comes with a boundle that introduces ROUTER_FAKE_PROVIDERS to fake routing in tests. These providers can be applied using beforeEachProviders() like any other provider.

describe('apps with router components', () => {
  beforeEachProviders(() => [ROUTER_FAKE_PROVIDERS]);

  it('should test something',
     async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
       tcb.createAsync(TestRouterComponent)
           .then((fixture) => { expect(fixture.nativeElement).toHaveText('one two'); });
     })));
});

4. HTML Sanitizer

Similar to Angular 1, there’s now a HTML sanitizer which takes care of parsing the HTML document and serializes only specifically whitelisted elements.

5. Documentation updated to RC changes

Pretty much all of the official docs are now updated to match the latest changes introduced in the release candidate. Great work, docs team!

Check them out right here.