Comments (7)
@tjvantoll You can still use the ngFor
approach for the groceries app. The main difference is that the list-view
is much more complex control that uses visualization and container recycling. However, for simple scenarios with smaller number of elements (e.x. when all elements are visible on one screen) there is no need for such optimization. You can see an example here.
That said, I agree that if you really need to use the list-view
- maybe we can think of a way to make it easier. Any suggestions are welcome.
from nativescript-angular.
Thanks @vakrilov,
The whole idea behind Groceries was to show how to implement common things people will need in their apps, and for that reason I really want to keep the <ListView>
in there. I think it’s reasonable that we have extra steps in place as long as they’re well documented and we can explain why they’re there. If we truly can’t get rid of any of these other steps, I’ll need some help in the future explaining why they’re necessary. For now I’ll think about ideas of how we might be able to clean things up. Ideally we could use something like this, because it’s pretty true to the ng2 web syntax:
<ListView>
<template *ngFor="#item of list">
<!-- use #item -->
</template>
</ListView>
... but I realize that’s probably not even possible.
from nativescript-angular.
What if we introduce our ngFor
like directive that will basically bind the ListView
's items
property to the Iterable
and bind the current variable name to the $value
in the template.
The Observable
\ WrappedValue
shouldn't be necessary if we monkey patch (mixin) the items
source object with an EventEmiiter
and emit the events we are expecting. We can emit those events using Angular's IterableDiffers
and DoCheck
abstractions.
from nativescript-angular.
The issue is fixed with commit #96. Generally new ListView component will support stock JavaScript array (both set directly or via RxjsObservable with async pipe). item-template
tag is not needed anymore. There is one known issue with a very easy workaround - ListView does not render if placed directly on Page, but wrapping it in any Layout control will do the job. For more information about how to set and use ListView see ListView
and ListViewAsync
updated examples.
from nativescript-angular.
Excellent! Can’t wait to try this out 😀
from nativescript-angular.
+1. When is this feature going to be ready?
from nativescript-angular.
Hi @tjvantoll ,
Are you familiar with the problem with NGFOR performance issues? I am finding when using NGFOR the rendering of lists is extremely slow...i.e. When you TAP and see the actual rendering complete (it can take upto 2 seconds) on a IPHONE 6....This seems quite unreasonable - which is basically what I am using across my APP - but finding the whole experience extremely poor....
I thought I'd point you to an issue I have opened - which hasn't had any major interest from the {N} team to look at - so thought to ask if it is something genuinely going wrong. or is it my approach. As theoretically speaking this should be quick (super-quick).
Check out the already opened issue here:
#500
PS: Check out the issue number (500) <---- internal error.....No coincidence here...lol
Thanks in advance.
from nativescript-angular.
Related Issues (20)
- Livesync doesnt work with two android emulator
- ngFor broken in child components with delayed initialization HOT 1
- [Android] Keyboard overlap content when router in use
- ERROR NullInjectorError: R3InjectorError(AppModule)[Page -> Page -> Page]: HOT 7
- Question - Showing an nativescript angular app in a angular website HOT 4
- Nativescript/Angular app UI is freezing HOT 5
- Angular 12 migration leads to huge amounts of Change Detection cycles HOT 1
- Nativescript iOS & Android runtime issue module not found
- (android) Navigation does not work when the app is started while the device is locked HOT 4
- Cannot read property 'call' of undefined
- iOS 15 status bar issue HOT 1
- [Element] is not a known element HOT 1
- [iOS] Issue while opening dialogs inside a modal
- Error on run blank Angular project HOT 2
- Android : ModalDialogOptions in Nativescript/Angular fails and throws an exception
- Wrapping a spec in fakeAsync results in ProxyZone error on a new app HOT 2
- Generate component does not add automatically to module
- bottom navigation bar nativescript
- Error: Need to call TestBed.initTestEnvironment() first
- FontAwesome 6 icons not showing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-angular.