Every line of 'react ngif' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
104 function NgIf(_viewContainer, templateRef) { 105 this._viewContainer = _viewContainer; 106 this._context = new NgIfContext(); 107 this._thenTemplateRef = null; 108 this._elseTemplateRef = null; 109 this._thenViewRef = null; 110 this._elseViewRef = null; 111 this._thenTemplateRef = templateRef; 112 }
5 function NgIf(_viewContainer, _templateRef) { 6 this._viewContainer = _viewContainer; 7 this._templateRef = _templateRef; 8 this._prevCondition = null; 9 }
187 set ngIfElse(templateRef: TemplateRef>|null) { 188 assertTemplate('ngIfElse', templateRef); 189 this._elseTemplateRef = templateRef; 190 this._elseViewRef = null; // clear previous view if any. 191 this._updateView(); 192 }
44 ifDirectiveOperate(flag: boolean) { 45 if (flag) { 46 this.pt.show(); 47 } else { 48 this.pt.hide(); 49 } 50 }
57 function _if(el, value, directive) { 58 remove(el, directive); 59 beforeText(el, `\${${value} ? `); 60 const rElse = el.nextElementSibling; 61 if (rElse && has(rElse, 'else')) { 62 wrapAround(el, `\``, `\``); 63 remove(rElse, 'else'); 64 wrapAround(rElse, `:\``, `\`}`); 65 } else { 66 wrapAround(el, `\``, `\`:\`\`}`); 67 } 68 }
7 export default function If(_ref) { 8 var condition = _ref.condition, 9 children = _ref.children; 10 11 return condition ? children : null; 12 }
141 export function inlineIf(_vm: VM, { positional }: Arguments) { 142 assert( 143 'The inline form of the `if` helper expects two or three arguments, e.g. ' + 144 '`{{if trialExpired "Expired" expiryDate}}`.', 145 positional.length === 3 || positional.length === 2 146 ); 147 return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); 148 }
359 function renderIfBlock_0 ( root, component ) { 360 var p = document.createElement( 'p' ); 361 p.setAttribute( 'svelte-3293511188', '' ); 362 363 p.appendChild( document.createTextNode( "loading..." ) ); 364 365 return { 366 mount: function ( target, anchor ) { 367 target.insertBefore( p, anchor ); 368 }, 369 370 update: function ( changed, root ) { 371 372 }, 373 374 teardown: function ( detach ) { 375 if ( detach ) { 376 p.parentNode.removeChild( p ); 377 } 378 } 379 }; 380 }
824 render(props) { 825 const NEWLINE = <br /> 826 let branches = []; 827 this.branches.forEach((element, index) => { 828 let span = <span> 829 830 {NEWLINE} 831 {element.reactElement()} 832 {NEWLINE} 833 </span>; 834 branches.push(span); 835 }); 836 branches.push(); 837 838 return ( 839 840 <span> 841 ask: 842 </span> 843 <div> 844 {branches} 845 </div> 846 847 ); 848 }
99 constructor(private _hostRef: ElementRef, private render: Renderer2, private _changeDetectorRef: ChangeDetectorRef) { 100 }