Using alpha33 and trying to understand the workings of the Angular2
lifecycle events. I built a component and attempted to hook the lifecycle
events I see defined in LifecycleEvent. My first problem is that all the
examples I see declare this as follows:
import {Component, View, ElementRef, onChange, onInit} from "angular2/angular2";
@Component({
selector: "tabular-grid-eg",
lifecycle: [onChange, onInit]
})
@View({
templateUrl: "ui/tabulargrid/tabulargridegA2.html"
})
export class TabularGridEgCmpA2 extends AppCmpBaseA2
{
However, my TS compiler refuses to compile this, telling me that *onInit *is
not defined. What seems to compile is:
import {Component, View, ElementRef, LifecycleEvent} from "angular2/angular2";
@Component({
selector: "tabular-grid-eg",
lifecycle: [LifecycleEvent.onChange, LifecycleEvent.onDestroy,
LifecycleEvent.onChange, LifecycleEvent.onCheck,
LifecycleEvent.onAllChangesDone]
})
@View({
templateUrl: "ui/tabulargrid/tabulargridegA2.html"
})
export class TabularGridEgCmpA2 extends AppCmpBaseA2
{
However, the *onChange(changes)* handler never gets called. I do see
*onInit()*, *onCheck() *and the others, but never a *onChange()*. I am
definitely changing controller properties that are bound to the view. Can
anyone explain why this is happening? What could I be doing wrong?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.