O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a view

In this recipe, we isolate the code for the filters from previous recipe in its own component: search_job in the folder lib\component\. You can follow along with the code in the project angular_view.

How to do it...

The change we make in this recipe is transparent to the user; the web page stays the same, but the project code is refactored.

  1. In our main web page angular-view.html, the <div id="filters"> section is now replaced by the HTML code for the component. Have a look at the following code:
      <search-job
           type-filter="ctrl.typeFilter"
           company-filter-map="ctrl.companyFilterMap">
      </search-job>
    
  2. In the constructor of JobListingController, the following code is added:
     for (var company in companies) { companyFilterMap[company] = false; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required