Angular 2가 드디어 대개 최종 배포 직전이라는 RC (Release Candidate) 6에 이르다니, 마침내 Angular 2의 시대가 오는건가…!

릴리즈 노트를 살펴보니 RC 5와 많이 달라진 점은 다음과 같다.

  • npm packages: code in ESM (ES6 Modules) format is now published at the default location in the npm package with package.json’s main entry pointing to an UMD bundle (primarily for node, and webpack 1 users).
    If you are using SystemJS to load Angular, you should adjust your SystemJS configuration to point to the UMD bundles (present in the npm package).
    Please see this example SystemJS config.

  • testing config: due to zone.js peer-dependency upgrade, the order in which various zone specs are loaded has changed.
    Please see this example Karma config.

  • core: Type is now Type which means that in most cases you have to use Type in place of Type.
    We don’t expect that any user applications use the Type type directly.

  • core: Previously inconsistently named APIs SanitizationService and DomSanitizationService were renamed to Sanitizer and DomSanitizer

  • core: previously deprecated @Component.directives and @Component.pipes support was removed.
    All the components and pipes now must be declared via an NgModule. NgModule is the basic compilation block passed into the Angular compiler via Compiler#compileModuleSync or #compileModuleAsync.
    Because of this change, the Compiler#compileComponentAsync and #compileComponentSync were removed as well - any code doing compilation should compile module instead using the APIs mentioned above.

    Lastly, since modules are the basic compilation unit, the ngUpgrade module was modified to always require an NgModule to be passed into the UpgradeAdapter’s constructor - previously this was optional.

  • core: deprecated ComponentResolver was removed. Please use ComponentFactoryResolver instead.

  • core: animations defined using an at-symbol prefix that are not property bound are now invalid.

<!-- this is now invalid -->
<div @flip="flipState"></div>

<!-- change that to -->
<div [@flip]="flipState"></div>
  • core: Animations that are not bound using the at-symbol prefix using animate- must now be preixed using bind-animate-.
<!-- this is now invalid -->
<div animate-flip="flipState"></div>

<!-- is valid now -->
<div bind-animate-flip="flipState"></div>
  • core: These forms of providers are no longer accepted:
bind(MyClass).toFactory(...)
new Provider(MyClass, toFactory: ...)

We now only accept:

{provider: MyClass, toFactory: ...}
  • core: previously deprecated NgZoneError has been removed

  • core: Exceptions are no longer part of the public API. We don’t expect that anyone should be referring to the Exception types.

ExceptionHandler.call(exception: any, stackTrace?: any, reason?: string): void;

change to:

ErrorHandler.handleError(error: any): void;
  • core: deprecated DynamicComponentLoader was removed; see deprecation notice for migration instructions.

  • core: deprecated SystemJsComponentResolver and SystemJsCmpFactoryResolver have been removed.

  • core: previously deprecated coreBootstrap and coreLoadAndBootstrap have been removed.

  • core: all previously deprecated ApplicationRef apis have been removed.

  • core: deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() - follow deprecation instructions to upgrade

  • core: deprecated disposePlatform was removed; see deprecation notice for migration instructions.

  • core: deprecated DirectiveMetadataType#properties and DirectiveMetadataType#events were removed; see deprecation notice for migration instructions.

  • core: deprecated lockRunMode was removed; see deprecation notice for migration instructions.

  • core: deprecated DebugNode#inject was removed, see deprecation notice for migration instructions.

  • core: deprecated Query and ViewQuery were removed; see deprecation notice for migration instructions.

  • core/testing: deprecated TestComponentBuilder was removed, please use TestBed instead

  • compiler: Previously deprecated# and var are not supported any more in expressions within templates, use let:

  • var- cannot be used any more on templates, use let-

  • var- cannot be used any more to create a reference, use ref-

  • http: any code which relies on the fact that a newly created Headers object is referencing an existing Headers map is now broken, but that should normally not be the case since this behavior is not documented and not in accordance with the spec.

  • http: previously deprecated HTTP_PROVIDERS and JSONP_PROVIDERS were removed; see deprecation notice for migration instructions.

  • platform-browser-dynamic: CACHED_TEMPLATE_PROVIDER is now renamed to RESOURCE_CACHE_PROVIDER

Before:

import {CACHED_TEMPLATE_PROVIDER} from '@angular/platform-browser-dynamic';

After:

import {RESOURCE_CACHE_PROVIDER} from '@angular/platform-browser-dynamic';
  • common: previously deprecated NgSwitchWhen directive was removed, use NgSwitchCase instead

  • common: previously deprecated ReplacePipe was removed

  • upgrade: deprecated UpgradeAdapter#addProvider was removed, see deprecation notice for migration instructions.

  • forms: deprecated provideForms() and disableDeprecatedForms() functions have been removed. Please import the FormsModule or the ReactiveFormsModule from @angular/forms instead.

  • forms: deprecated forms APIs in @angular/common have been removed. Please update to the new forms API in @angular/forms. See angular.io for more information.

  • webworkers: web worker platform is now exported via separate packages.

Please use @angular/platform-webworker and @angular/platform-webworker-dynamic