Wait for the Bindings of a Directive in Angular

If you’ve worked with angular for a while, you’ve probably found yourself having a directive like <my-directive my-prop=”myProp”></my-directive> where not having myProp┬áready yet (e.g. it’s retrieved from the server asynchronously) lead to problems. For example if the first thing you do in your directive is to call┬ámyProp.sayHello(), your app will crash saying cannot read property […]