Every line of 'ionic lifecycle events' 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.
43 lifecycle(modalEvent) { 44 const el = this.usersElement; 45 const name = LIFECYCLE_MAP[modalEvent.type]; 46 if (el && name) { 47 const ev = new CustomEvent(name, { 48 bubbles: false, 49 cancelable: false, 50 detail: modalEvent.detail 51 }); 52 el.dispatchEvent(ev); 53 } 54 }
70 function handleLifeCycle(event, component) { 71 // todo: early exit logic, if we've crawled a parent alreadycd 72 // then lets not crawl it again. 73 let walk = (event, component) => { 74 let handler = 75 component[event.type] || 76 (component.props && component.props[event.type]); 77 if (handler) { 78 // if the component is currently already awaiting notification queue 79 // then notify 80 let lifeCycleID = component.uuid + event.type; 81 lifeCycleQueue.unshift(lifeCycleID); 82 83 // only register if the lifecycleid isn't found, or the component in the notifier has changed 84 if ( 85 !lifeCycleNotifiers[lifeCycleID] || 86 lifeCycleNotifiers[lifeCycleID].component !== component 87 ) { 88 lifeCycleNotifiers[lifeCycleID] = { 89 component: component, 90 event: event, 91 }; 92 } 93 } 94 }; 95 96 walk(event, component); 97 fireLifeCycle(lifeCycleNotifiers); 98 }
27 ngOnChanges(changes: {[propertyName: string]: SimpleChange}){console.log('ngOnChanges',changes)}