Ionic with mithril

Hi All,

I currently building an app which shows the recent posts made in our company’s blog. The list item contains a title with an image (like in news feed). I implemented lazy loading using ion-scroll directive. But, now I am facing scroll performance problems as the feed grows in size. Nevertheless, the feed cannot exceed 50 items. After some research, I find that mithril can solve this. Does any one have a sample integration of mithril as a view layer please ? I am having some weird problems when I tried integrating mithril using this post.Here is the stack trace

TypeError: Cannot read property 'length' of undefined
    at clear (https://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.33/mithril.js:392:21)
    at Function.m.render (https://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.33/mithril.js:469:36)
    at link (http://localhost:8100/app/on-boarding/home-famous/home.js:29:11)
    at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:16019:9)
    at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:15531:11)
    at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13)
    at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:24)
    at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13)
    at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:24)
    at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13) <test-widget onclick="c.doStuff()">

Can you put together a codepen? Also, the collection-repeat directive should be able to solve the performance issue if you’re using rc0 and above

@djett Sorry for being late in responding to your reply. I have solved the problem using overflow : true on my app. This improved performance drastically. Earlier, I was using ionic scroll. Nevertheless, I will put together a codepen for mithril and repost on the same thread

2 Likes