Skip to content

Commit

Permalink
refactor(compiler): clean up directive normalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzmitry Shylovich authored and hansl committed Dec 28, 2016
1 parent 7690d02 commit 5b4bea2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/@angular/compiler/src/directive_normalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ViewEncapsulation} from '@angular/core';

import {CompileAnimationEntryMetadata, CompileDirectiveMetadata, CompileStylesheetMetadata, CompileTemplateMetadata, CompileTypeMetadata} from './compile_metadata';
import {CompilerConfig} from './config';
import {isBlank, isPresent, stringify} from './facade/lang';
import {stringify} from './facade/lang';
import {CompilerInjectable} from './injectable';
import * as html from './ml_parser/ast';
import {HtmlParser} from './ml_parser/html_parser';
Expand Down Expand Up @@ -41,9 +41,9 @@ export class DirectiveNormalizer {
private _resourceLoader: ResourceLoader, private _urlResolver: UrlResolver,
private _htmlParser: HtmlParser, private _config: CompilerConfig) {}

clearCache() { this._resourceLoaderCache.clear(); }
clearCache(): void { this._resourceLoaderCache.clear(); }

clearCacheFor(normalizedDirective: CompileDirectiveMetadata) {
clearCacheFor(normalizedDirective: CompileDirectiveMetadata): void {
if (!normalizedDirective.isComponent) {
return;
}
Expand All @@ -65,7 +65,7 @@ export class DirectiveNormalizer {
SyncAsyncResult<CompileTemplateMetadata> {
let normalizedTemplateSync: CompileTemplateMetadata = null;
let normalizedTemplateAsync: Promise<CompileTemplateMetadata>;
if (isPresent(prenormData.template)) {
if (prenormData.template) {
normalizedTemplateSync = this.normalizeTemplateSync(prenormData);
normalizedTemplateAsync = Promise.resolve(normalizedTemplateSync);
} else if (prenormData.templateUrl) {
Expand Down Expand Up @@ -120,7 +120,7 @@ export class DirectiveNormalizer {
{styles: visitor.styles, styleUrls: visitor.styleUrls, moduleUrl: templateAbsUrl}));

let encapsulation = prenomData.encapsulation;
if (isBlank(encapsulation)) {
if (encapsulation == null) {
encapsulation = this._config.defaultEncapsulation;
}

Expand Down

0 comments on commit 5b4bea2

Please sign in to comment.