GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • DoCheck
  • OnInit
  • Lifecycle hooks guide

This view

  • Original page
  • New address

GeezerVison is showing angular.dev — OnChanges • Angular

API

    
      interface OnChanges {}
    
    

A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

@paramchanges{ [propName: string]: SimpleChange<any>; }

The changed properties.

@returnsvoid

Usage Notes

The following snippet shows how a component can implement this interface to define an on-changes handler for an input property. While you should prefer computed and effect when working with signal-based inputs, the ngOnChanges method does include value changes for signal-based inputs.

@Component({ ... })
export class UserProfile implements OnChanges {
  userId = input<number>(0);
  ngOnChanges(changes: SimpleChanges<UserProfile>) {
    // changes.userId contains the old and new value.
  }
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.