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.



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.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?