Sharing Top Content from the Angular-sphere.

$onInit and new “require” Object syntax in Angular components @toddmotto

  • The much needed callback when a component is mounted and ready – $onInit !
  • component ( ‘childComponent’ , { require : {}, controller : function () { }, template : `
    Component !
  • . component ( ‘childComponent’ , { require : { parent : ‘^parentComponent’ }, controller : function () { this .

Read the full article, click here.


@toddmotto: “Using require: [‘component’] is obsolete in .component(), learn new require Object + $onInit to inherit parent ctrl:”


The component() helper method shipped with so many great features to take us even closer towards Angular 2 syntax and integration. Let’s explore the $onInit …


$onInit and new “require” Object syntax in Angular components @toddmotto

Comments are closed, but trackbacks and pingbacks are open.