lazy-loading

How to lazy load a route as a child route/component

让人想犯罪 __ 提交于 2019-11-30 15:24:42
Let's take a look at my plunker: https://plnkr.co/edit/22RIoGsvzfw2y2ZTnazg?p=preview I want to lazy load a Module as a child-route. So the route /lazy should render the LazyModule into the <router-outlet> of my MainComponent . Then it will switch between that DummyComponent and the lazy loaded Module. Instead now that lazy loaded Module will be rendered into the AppComponent .. Any ideas? If you want to lazy load a module, do not import it as you've done here : src/app.ts : import { LazyModule } from './lazy/lazy.module'; ... @NgModule({ imports: [ BrowserModule, RouterModule.forRoot(routes),

Lazy-loaded NHibernate properties in Equals and GetHashCode

廉价感情. 提交于 2019-11-30 15:21:46
How can the following problem be dealt with? We're using lazy loaded NHibernate properties and whenever we're calling Equals() or GetHashCode() any properties used, will be lazy-loaded, potentially causing a cascade of lazy-loading operations. Eager-loading could be used as an alternative, but I think only in specific cases and not as a general solution. A typical scenario would look like this: public class AbstractSaveableObject { [Id(0, Name = "Id", UnsavedValue = null)] [Generator(1, Class = "native")] public virtual long? Id { get; set; } } [Class(NameType = typeof(ClassA))] public class

PrimeFaces dialog lazy loading (dynamic=“true”) does not work?

守給你的承諾、 提交于 2019-11-30 15:20:37
I have recently changed all my beans from RequestScoped to ViewScoped . Suddenly, the lazy loading of dialogs does not work. I am using PrimeFaces JSF library. <html> <h:body> <f:view> <h:form> <p:commandButton id="addId" value="Add" title="Add" type="button" onclick="dlgMultiFileSelect.show();"/> ... </h:form> <p:dialog header="Dialog" widgetVar="dlgMultiFileSelect" modal="true" resizable="true" dynamic="true"> <ui:include src="/dialogs/media_browser.xhtml"/> </p:dialog> </f:view> </h:body> </html> Seems like dynamic="true" does not work since the backing bean in media_browser.xhtml gets

Angular 5 lazy loading Error: Cannot find module

孤街浪徒 提交于 2019-11-30 15:10:01
I would like to use lazy loading but I can not understand why it does not work, it gives me error "Cannot find module". This is my environment: - Angular 5.2.1 - .NET Core 2 - Webpack 3.10.0 - angular-router-loader 0.8.2 - @angular/cli 1.6.5 I tried different path in loadChildren always without success, i also temporarily disabled all the guards and the children routing. What did I do wrong? FOLDERS ClientApp app components users users-routing.module.ts users.module.ts app-routing.module.ts app.module.shared.ts app-routing.module.ts const appRoutes: Routes = [ { path: 'users', loadChildren: '.

Need a sample for WPF TreeView search with Virtualization and Load On Demand

这一生的挚爱 提交于 2019-11-30 15:01:47
I need to implement search feature in WPF TreeView (basically I need to remember the last user selection). I have tried various approaches suggested but nothing works as virtualization is enabled in my TreeView and child nodes are loaded only when a parent node is expanded(lazy loading). Anyone knows of a sample having these three things(Virtualization, Load-on-demand and Search) implemented together? Have a look at this MSDN forum thread, Bob from MS explains the problem in implementing this feature. the cause is the VirtualizingStackPanel try to generate a item for display, but it has a

How to fetch a field lazily with Hibernate Criteria

孤者浪人 提交于 2019-11-30 14:47:44
问题 Each row of the table Person (having name , firstname and age ) shall be read. EntityManager em = emf.createEntityManager(); Session s = (Session) em.getDelegate(); Criteria criteria = s.createCriteria(Person.class); criteria.setFetchMode("age", FetchMode.SELECT); But the SQL shows Hibernate: select person0_.name, person0_.firstname, person0_.age from SCOPE.PERSON person0_ How to let the age be lazy ONLY for the Criteria?? 回答1: I think that lazy mode only makes sense with associations. If you

angular2 rc.4 layz routing

半世苍凉 提交于 2019-11-30 14:44:39
Angular2 rc.4 lazy Routing is depreciated. Async Routing example is there any new lazy routing / async routing example for rc.4 loadChildren is supposed to do that: { path: 'section', loadChildren: 'section-bundle' } I don't know what exactly the string should point to. See also https://github.com/angular/angular/issues/9527#issuecomment-236038503 https://github.com/angular/angular/issues/10577 (with Plunker) { path: 'heroes', loadChildren: 'app/hero/hero.module' } 来源: https://stackoverflow.com/questions/38837493/angular2-rc-4-layz-routing

virtual keyword, Include extension method, lazy loading, eager loading - how does loading related objects actually work

点点圈 提交于 2019-11-30 14:20:45
Loading related object in MVC can be pretty confusing. There are lots of terms you need to be aware of and learn if you really want to know what you're doing when writing your entity model classes and controllers. A couple of questions that I've had for a very long time are: How does the virtual keyword work and when should I use it? And how does the Include extension method work and when should I use it? Here's what I'm talking about; virtual keyword: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LazyLoading.Models { public class Brand { public

Images were Shuffled when scrolling a ListView with a ViewHolder

♀尐吖头ヾ 提交于 2019-11-30 13:37:02
My problem is connected when the user scrolls the ListView. I looked around and saw numerous examples of 'listview lazy image', has also watched the video of the Google IO which speaks of 'good practice ' to make this work. But my problem continues when the user moves up and down the ListView. What happens is that when scrolling the list, the images that were loaded on each item are shuffled, and the avatar of each item going to the next item ends. I do not know if I'm being clear but I will show with the image. When you start, items that have no image left with the standard image. Image 1:

How to lazy load Angular 2 components in a TabView (PrimeNG)?

ぃ、小莉子 提交于 2019-11-30 13:29:51
问题 It is my app.component.ts: import { Component } from '@angular/core'; @Component({ templateUrl: 'app/app.component.html', selector: 'my-app' }) export class AppComponent { } And this is my app.component.html: <p-tabView> <p-tabPanel header="Home" leftIcon="fa-bar-chart-o"> <home-app></home-app> </p-tabPanel> <p-tabPanel header="Hierarquia" leftIcon="fa-sitemap"> <tree-app></tree-app> </p-tabPanel> <p-tabPanel header="Configurações" leftIcon="fa-cog"> <config-app></config-app> </p-tabPanel> <