@isoden/ngx-unless
Version:
An Angular module to add unless syntax to template.
83 lines (78 loc) • 2.33 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :
(factory((global['ngx-unless'] = {}),global.ng.core));
}(this, (function (exports,core) { 'use strict';
var UnlessDirective = (function () {
/**
* @param {?} viewContainerRef
* @param {?} templateRef
*/
function UnlessDirective(viewContainerRef, templateRef) {
this.viewContainerRef = viewContainerRef;
this.templateRef = templateRef;
}
Object.defineProperty(UnlessDirective.prototype, "ngxUnless", {
/**
* @param {?} condition
* @return {?}
*/
set: function (condition) {
if (Boolean(condition)) {
this.viewContainerRef.clear();
return;
}
this.viewContainerRef.createEmbeddedView(this.templateRef);
},
enumerable: true,
configurable: true
});
return UnlessDirective;
}());
UnlessDirective.decorators = [
{ type: core.Directive, args: [{
selector: '[ngxUnless]'
},] },
];
/**
* @nocollapse
*/
UnlessDirective.ctorParameters = function () { return [
{ type: core.ViewContainerRef, },
{ type: core.TemplateRef, },
]; };
UnlessDirective.propDecorators = {
'ngxUnless': [{ type: core.Input },],
};
/**
* @isoden/ngx-unless - An Angular module to add unless syntax to template.
*
* https://github.com/isoden/ngx-unless
*
* Copyright (c) 2018 Yu Isoda
* Licensed under the MIT license. https://isoden.mit-license.org
*/
var UnlessModule = (function () {
function UnlessModule() {
}
return UnlessModule;
}());
UnlessModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [
UnlessDirective,
],
exports: [
UnlessDirective,
],
},] },
];
/**
* @nocollapse
*/
UnlessModule.ctorParameters = function () { return []; };
exports.UnlessModule = UnlessModule;
exports.UnlessDirective = UnlessDirective;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ngx-unless.umd.js.map