From the course: Building Native Mobile Apps with NativeScript and Angular 2
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Template variables - JavaScript Tutorial
From the course: Building Native Mobile Apps with NativeScript and Angular 2
Template variables
- [Instructor] One of the most common ways you'll show repeating, templated data is using a ListView widget. This UI widget has many benefits that you don't necessarily see right away because NativeScript translates them directly into their native equivalents. There are many optimizations that native platforms provide for displaying long, smoothly scrolling lists of data including row virtualization. You might wonder, why not just use the ngFor directive that Angular provides? You certainly can use ngFor, but use it for relatively short lists since it doesn't have the native optimizations built in. But, keep in mind that the ListView widget is quite powerful and can be used for short lists as well as very long lists. Let's take a look at our ListView in the pt-items-list component. Currently, our items are bound to the ptItems property and has very simple template, which consists only of a label and displays the title of each backlog item that's hard coded in the component. The…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Components5m
-
Component template2m 58s
-
Component styles2m 25s
-
Template variables3m 41s
-
Handling Listview tap2m 33s
-
Backlog item template4m 9s
-
Nested layouts4m 50s
-
Directives: ngIf6m 52s
-
Directives: ngFor3m 48s
-
Dependency injection: Part 14m 26s
-
Dependency injection: Part 26m 31s
-
Application lifecycle9m 56s
-
Modules3m 40s
-
Barrels2m 6s
-
-
-
-
-