Skip to Content
Learn
Directives
Directives III

Why is creating your own directives useful?

  1. Readability. Directives let you write expressive HTML. Looking at index.html you can understand the app’s behavior just by reading the HTML.
  2. Reusability. Directives let you create self-contained units of functionality. We could easily plug in this directive into another AngularJS app and avoid writing a lot of repetitive HTML.

Instructions

1.

In the controller, there is a new property $scope.forecast. Display this property in the view by creating another <div class="card"> element containing an <app-info> element.

Folder Icon

Take this course for free

Already have an account?