lazy-loading

Routing to sub routing module without lazy loading

与世无争的帅哥 提交于 2019-12-05 04:34:27
I want to have multiple routing modules in order to keep my application clean and easy to read. I currently use lazy loading for the SubComponent but I don't want to do this. So I am looking for a way to change this. Anyways, here is the currently working code. I have the following two routing files. app-routing.module.ts : import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'sub', loadChildren: './sub/sub.module#SubModule' } ]; @NgModule({ imports: [RouterModule.forRoot

Spring @Autowired @Lazy

ぃ、小莉子 提交于 2019-12-05 03:47:32
I'm using Spring annotations and I want to use lazy initialization. I'm running into a problem that when I want to import a bean from another class I am forced to use @Autowired which does not seem to use lazy init. Is there anyway to force this lazy init behaviour? In this example I do not want to see "Loading parent bean" ever being printed as I am only loading childBean which has no dependencies on lazyParent . @Configuration public class ConfigParent { @Bean @Lazy public Long lazyParent(){ System.out.println("Loading parent bean"); return 123L; } } @Configuration @Import(ConfigParent.class

Angular2 lazy loading modules: how to create a build package with SystemJS Builder?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 03:45:02
i'm using Angular2 and SystemJS to create a web application. I have some modules in my app and in the router configuration i use lazy loading to open them. Here is a routing file of my app that lazy loads two modules: const appRoutes: Routes = [ { path: '', component: MainComponent, canActivate: [AuthGuard], children: [ { path: 'dashboard', component: DashboardComponent }, { path: 'first-section', loadChildren: 'app/modules/FIRST-SECTION/first-section.module' }, { path: 'second-section', loadChildren: 'app/modules/SECOND-SECTION/second-section.module' }, { path: 'documents', component:

spring rest lazy loading with hibernate

我的未来我决定 提交于 2019-12-05 03:14:37
问题 I am trying to develop spring rest api with hibernate. after searching in google, I have not find solution to lazy loading. I have two entity like below: University.java @Entity() @Table(schema = "core", name = "university") public class University extends BaseEntity { private String uniName; private String uniTelephon; @LazyCollection(LazyCollectionOption.FALSE) @OneToMany(fetch = FetchType.LAZY, mappedBy = "university", cascade = CascadeType.ALL) @JsonManagedReference private List<Student>

Angular2 with Typescript, how to use Plupload CDN script file in lazy-loaded module?

瘦欲@ 提交于 2019-12-05 00:40:38
I would like to use Plupload in an Angular2 component and access the Plupload JavaScript file from a CDN. I want it specific to a component so that it is not downloaded if it is not required - I want it to be in a lazy loaded module. How can I do this? Now fully answered on this page! The result of this quest, which included offering and awarding bounties to two people who worked hard with me on it, is as follows: Example of using Plupload with Angular 2 and TypeScript How to Lazy load a script from a CDN in Angular 2 Example of how to use Plupload in a lazy loaded module How to use a lazy

How to lazy load a many-to-many collection in hibernate?

痞子三分冷 提交于 2019-12-05 00:32:37
I can lazy load one-to-many and many-to-one associations but I can't with the many-to-many associations. We have a city in wich we have merchants wich have adresses. Merchants can have multiple addresses and multiple merchants can have the same addresses. When we load a merchant with a get, Merchant merchant = (Merchant) hib_session.get(Merchant.class, id); System.out.println(merchant.getName()); it's ok, addresses aren't load until we iterate over them. But when we load a list of merchants, City city = (City) hib_session.get(City.class, city_name); for(Merchant merchant : city.getMerchants())

Dynamically create a treeview

怎甘沉沦 提交于 2019-12-04 23:42:16
问题 I am trying to create a treeview dynamically using c# and asp.net. I have created a lazy load treeview using the populate ondemand attribute. > <asp:TreeView ID="treeView1" runat="server" > OnTreeNodePopulate="treeview1_TreeNodePopulate"></asp:TreeView> Behind code I have loaded my data but initially I populate the parent nodes. What I want to achieve is when i click on parent node I then do a postback and then populate its child and then again populate its child's and so now. I have

Hibernate: @ManyToOne(fetch = FetchType.LAZY) does not work on non-primary key referenced column

给你一囗甜甜゛ 提交于 2019-12-04 22:49:45
I have 2 tables: Order [OrderId(PK), OrderShipmentCode, ...] and Shipment[ShipmentId(PK), ShipmentCode, ...] . In Order class, I declared shipment field as follows: @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "OrderShipmentCode", referencedColumnName = "ShipmentCode", insertable = false, updatable = false, nullable = false) private Shipment shipment; When I get the list of Order , the Shipment is also loaded (I saw many separate SELECT queries). But I want the Shipment to be lazy loaded, not to be fetched together with Order . For other tables, if the referenced column is primary key

Modularize AngularJS application : one or multiple AngularJS modules?

天涯浪子 提交于 2019-12-04 21:59:03
问题 I try to build a modular application using AngularJS. My first idea is to group each module by functionnality with this kind of folder structure : /core controllers.js directives.js app.js /modules /users controllers.js directives.js /invoices controllers.js directives.js /messages controllers.js directives.js ... Notice that the "core" folder contains basics features that will always be in the app. Others modules can be add or remove independently. As my application will be large, I also

Lazy Instantiation Disadvantages iOS [closed]

五迷三道 提交于 2019-12-04 21:51:40
So it seems lazy instantiation is widely used and everybody know the advantages of lazy instantiation. Which leads to the question: should we lazy instantiate every object? Which I seriously doubt. So the question is, what are the disadvantages of lazy instantiation? Sample taken from (Apple Sample LocateMe): - (NSDateFormatter *)dateFormatter { if (dateFormatter == nil) { dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; [dateFormatter setTimeStyle:NSDateFormatterLongStyle]; } return dateFormatter; } This will give us the advantage of