How to use the angular2/src/facade/lang.isBlank function in angular2

To help you get started, we’ve selected a few angular2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tpadjen / ng2-prism / jspm_packages / npm / angular2@2.0.0-beta.12 / src / platform / browser / browser_adapter.js View on Github external
function getBaseElementHref() {
    if (lang_1.isBlank(baseElement)) {
        baseElement = document.querySelector('base');
        if (lang_1.isBlank(baseElement)) {
            return null;
        }
    }
    return baseElement.getAttribute('href');
}
// based on urlUtils.js in AngularJS 1
github panacloud / learn-angular / step9_gulp_router / node_modules / angular2 / src / core / compiler / element_injector.js View on Github external
return this._obj3;
        }
        if (p._keyId4 === keyId && (p._visibility4 & visibility) > 0) {
            if (lang_1.isBlank(this._obj4)) {
                this._obj4 = this._ei._new(p._binding4);
            }
            return this._obj4;
        }
        if (p._keyId5 === keyId && (p._visibility5 & visibility) > 0) {
            if (lang_1.isBlank(this._obj5)) {
                this._obj5 = this._ei._new(p._binding5);
            }
            return this._obj5;
        }
        if (p._keyId6 === keyId && (p._visibility6 & visibility) > 0) {
            if (lang_1.isBlank(this._obj6)) {
                this._obj6 = this._ei._new(p._binding6);
            }
            return this._obj6;
        }
        if (p._keyId7 === keyId && (p._visibility7 & visibility) > 0) {
            if (lang_1.isBlank(this._obj7)) {
                this._obj7 = this._ei._new(p._binding7);
            }
            return this._obj7;
        }
        if (p._keyId8 === keyId && (p._visibility8 & visibility) > 0) {
            if (lang_1.isBlank(this._obj8)) {
                this._obj8 = this._ei._new(p._binding8);
            }
            return this._obj8;
        }
github FuelInteractive / fuel-ui / node_modules / angular2 / es6 / dev / src / compiler / selector.js View on Github external
_matchTerminal(map, name, cssSelector, matchedCallback) {
        if (isBlank(map) || isBlank(name)) {
            return false;
        }
        var selectables = map.get(name);
        var starSelectables = map.get("*");
        if (isPresent(starSelectables)) {
            selectables = selectables.concat(starSelectables);
        }
        if (isBlank(selectables)) {
            return false;
        }
        var selectable;
        var result = false;
        for (var index = 0; index < selectables.length; index++) {
            selectable = selectables[index];
            result = selectable.finalize(cssSelector, matchedCallback) || result;
        }
github panacloud / learn-angular / step9_gulp_router / node_modules / angular2 / atscript / src / core / compiler / view_manager_utils.ts View on Github external
_hydrateView(view: viewModule.AppView, appInjector: Injector,
               hostElementInjector: eli.ElementInjector, context: Object, parentLocals: Locals) {
    if (isBlank(appInjector)) {
      appInjector = hostElementInjector.getShadowDomAppInjector();
    }
    if (isBlank(appInjector)) {
      appInjector = hostElementInjector.getLightDomAppInjector();
    }
    view.context = context;
    view.locals.parent = parentLocals;

    var binders = view.proto.elementBinders;
    for (var i = 0; i < binders.length; ++i) {
      var elementInjector = view.elementInjectors[i];
      if (isPresent(elementInjector)) {
        elementInjector.hydrate(appInjector, hostElementInjector, view.preBuiltObjects[i]);
        this._setUpEventEmitters(view, elementInjector, i);
        this._setUpHostActions(view, elementInjector, i);
github FuelInteractive / fuel-ui / node_modules / angular2 / es6 / prod / src / compiler / provider_parser.js View on Github external
_getOrCreateLocalProvider(requestingProviderType, token, eager) {
        var resolvedProvider = this._allProviders.get(token);
        if (isBlank(resolvedProvider) ||
            ((requestingProviderType === ProviderAstType.Directive ||
                requestingProviderType === ProviderAstType.PublicService) &&
                resolvedProvider.providerType === ProviderAstType.PrivateService) ||
            ((requestingProviderType === ProviderAstType.PrivateService ||
                requestingProviderType === ProviderAstType.PublicService) &&
                resolvedProvider.providerType === ProviderAstType.Builtin)) {
            return null;
        }
        var transformedProviderAst = this._transformedProviders.get(token);
        if (isPresent(transformedProviderAst)) {
            return transformedProviderAst;
        }
        if (isPresent(this._seenProviders.get(token))) {
            this._viewContext.errors.push(new ProviderError(`Cannot instantiate cyclic dependency! ${token.name}`, this._sourceSpan));
            return null;
        }
github angular / angular / modules / angular2 / src / dom / browser_adapter.es6 View on Github external
function relativePath(url) {
  if (isBlank(urlParsingNode)) {
    urlParsingNode = document.createElement("a");
  }
  urlParsingNode.setAttribute('href', url);
  return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname;
}
github tpadjen / ng2-prism / jspm_packages / npm / angular2@2.0.0-beta.12 / es6 / prod / src / core / change_detection / dynamic_change_detector.js View on Github external
_updateDirectiveOrElement(change, bindingRecord) {
        if (isBlank(bindingRecord.directiveRecord)) {
            super.notifyDispatcher(change.currentValue);
        }
        else {
            var directiveIndex = bindingRecord.directiveRecord.directiveIndex;
            bindingRecord.setter(this._getDirectiveFor(directiveIndex), change.currentValue);
        }
        if (this._genConfig.logBindingUpdate) {
            super.logBindingUpdate(change.currentValue);
        }
    }
    /** @internal */
github panacloud / learn-angular / step9_gulp_router / node_modules / angular2 / atscript / src / core / compiler / view_manager_utils.ts View on Github external
attachViewInContainer(parentView: viewModule.AppView, boundElementIndex: number,
                        contextView: viewModule.AppView, contextBoundElementIndex: number,
                        atIndex: number, view: viewModule.AppView) {
    if (isBlank(contextView)) {
      contextView = parentView;
      contextBoundElementIndex = boundElementIndex;
    }
    parentView.changeDetector.addChild(view.changeDetector);
    var viewContainer = parentView.viewContainers[boundElementIndex];
    if (isBlank(viewContainer)) {
      viewContainer = new viewModule.AppViewContainer();
      parentView.viewContainers[boundElementIndex] = viewContainer;
    }
    ListWrapper.insert(viewContainer.views, atIndex, view);
    var sibling;
    if (atIndex == 0) {
      sibling = null;
    } else {
      sibling = ListWrapper.last(viewContainer.views[atIndex - 1].rootElementInjectors)
    }
    var elementInjector = contextView.elementInjectors[contextBoundElementIndex];
    for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) {
      view.rootElementInjectors[i].linkAfter(elementInjector, sibling);
    }
  }
github angular / angular / modules / angular2 / src / core / compiler / pipeline / compile_element.js View on Github external
addPropertyBinding(property:string, expression:AST) {
    if (isBlank(this.propertyBindings)) {
      this.propertyBindings = MapWrapper.create();
    }
    MapWrapper.set(this.propertyBindings, dashCaseToCamelCase(property), expression);
  }
github angular / angular / modules / angular2 / src / router / route_registry.ts View on Github external
public generateDefault(componentCursor: Type): Instruction {
    if (isBlank(componentCursor)) {
      return null;
    }

    var componentRecognizer = this._rules.get(componentCursor);
    if (isBlank(componentRecognizer) || isBlank(componentRecognizer.defaultRoute)) {
      return null;
    }

    var defaultChild = null;
    if (isPresent(componentRecognizer.defaultRoute.handler.componentType)) {
      var componentInstruction = componentRecognizer.defaultRoute.generate({});
      if (!componentRecognizer.defaultRoute.terminal) {
        defaultChild = this.generateDefault(componentRecognizer.defaultRoute.handler.componentType);
      }
      return new DefaultInstruction(componentInstruction, defaultChild);
    }

    return new UnresolvedInstruction(() => {
      return componentRecognizer.defaultRoute.handler.resolveComponentType().then(
          (_) => this.generateDefault(componentCursor));
    });