claims.component uncomment this.sub | fill main.node.ts with contents of main.browser.ts --> solve reload problem in claims page

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43771 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2016-09-22 14:45:53 +00:00
parent d96bead723
commit 6c5687c80f
4 changed files with 57 additions and 15 deletions

View File

@ -3,9 +3,9 @@ import { Routes, RouterModule } from '@angular/router';
import {ClaimsAdminComponent} from './claimPages/claims/claimsAdmin.component'; import {ClaimsAdminComponent} from './claimPages/claims/claimsAdmin.component';
import {HomeComponent} from './home/home.component'; import {HomeComponent} from './home/home.component';
const appRoutes: Routes = [ const appRoutes: Routes = [
{ path: '', component: HomeComponent, pathMatch: 'full' },
{ path: 'claims', component: ClaimsAdminComponent }, { path: 'claims', component: ClaimsAdminComponent },
{ path: 'home', component: HomeComponent } { path: 'home', component: HomeComponent },
{ path: '', component: HomeComponent, pathMatch: 'full' }
]; ];

View File

@ -38,4 +38,8 @@ import 'rxjs/Rx';
}) })
export class App { export class App {
constructor() {
}
} }

View File

@ -18,9 +18,9 @@ export class ClaimsComponent {
} }
ngOnInit() { ngOnInit() {
// this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
var params = []; // var params = [];
if( this.myClaims == 'true' ){ if( this.myClaims == 'true' ){
this.fetchBy = "User"; this.fetchBy = "User";
}else{ }else{
@ -39,12 +39,12 @@ export class ClaimsComponent {
this.inputkeyword = this.keyword; this.inputkeyword = this.keyword;
this.page = ( page <= 0 ) ? 1 : page; this.page = ( page <= 0 ) ? 1 : page;
this.size = ( size <= 0 ) ? 10 : size; this.size = ( size <= 0 ) ? 10 : size;
this.entityTypes = []//(params['types']?params['types']:[]); this.entityTypes = [];//(params['types']?params['types']:[]);
this.setTypes(params['types']); // check the appropriate checkboxes this.setTypes(params['types']); // check the appropriate checkboxes
// this.setSortby(params['sort']); // this.setSortby(params['sort']);
this.getClaims(); this.getClaims();
// }); });
// this.sub = this.route.params.subscribe(params => { // this.sub = this.route.params.subscribe(params => {
// console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId); // console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId);
// if( this.myClaims == 'true' ){ // if( this.myClaims == 'true' ){

View File

@ -1,20 +1,58 @@
// import { NgModule } from '@angular/core';
// import { FormsModule } from '@angular/forms';
// import { RouterModule } from '@angular/router';
// import { UniversalModule } from 'angular2-universal';
// import { HomeComponent } from './app/home/home.component';
// import { App } from './app/app';
//
// @NgModule({
// bootstrap: [ App ],
// declarations: [ App, HomeComponent ],
// imports: [
// UniversalModule, // NodeModule, NodeHttpModule, and NodeJsonpModule are included
// FormsModule,
// RouterModule.forRoot([
// { path: '', component: HomeComponent, pathMatch: 'full' }
// ])
// ]
// })
// export class MainModule {
//
// }
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { UniversalModule } from 'angular2-universal'; import { UniversalModule } from 'angular2-universal';
import { HomeComponent } from './app/home/home.component';
import { App } from './app/app'; import { App } from './app/app';
//for routing:
import {ClaimsAdminComponent} from './app/claimPages/claims/claimsAdmin.component';
import { routing } from './app/app.routing';
import {Routes, RouterModule} from "@angular/router";
import {Open} from './app/common/modal/open.component';
import {Alert} from './app/common/modal/alert';
import {Loading} from './app/common/modal/loading.component';
import {ClaimsComponent} from './app/claimPages/claims/claims.component';
import {ClaimsService} from './app/services/claims.service';
import {Claim} from './app/entities/claim';
import {pagingFormatterNoLoad} from './app/common/pagingFormatterNoLoad.component';
import {ClaimEntityFormatter} from './app/common/claimEntityFormatter.component';
import {PublicationTitleFormatter} from './app/common/publicationTitleFormatter.component';
import {ProjectTitleFormatter} from './app/common/projectTitleFormatter.component';
import {HomeComponent} from './app/home/home.component';
@NgModule({ @NgModule({
bootstrap: [ App ], bootstrap: [ App ],
declarations: [ App, HomeComponent ], declarations: [ App, ClaimsAdminComponent, ClaimsComponent, ClaimEntityFormatter,pagingFormatterNoLoad, Open, ProjectTitleFormatter, PublicationTitleFormatter,HomeComponent, Loading, Alert],
imports: [ imports: [
UniversalModule, // NodeModule, NodeHttpModule, and NodeJsonpModule are included UniversalModule, // BrowserModule, HttpModule, and JsonpModule are included
FormsModule, FormsModule,
RouterModule.forRoot([ routing
{ path: '', component: HomeComponent, pathMatch: 'full' } ],
]) providers: [ ClaimsService ]
]
}) })
export class MainModule { export class MainModule {