Developer wishes to change the look and feel of the home page component
Note initial release will include component schematics for home page, case page, config page, login page, splash page → more sub-components to follow)
To create a new component based on the original Home Page Component :
If you want to change the logo on top left, you can do so by :
File is in .src/app/routes/starter-app/starter-app-component.html
You can get the list of parameter with autocompletion in well configured angular editor (here what you could see in webstorm)
[logoUrl]="logoUrl"
Edit the file .src/app/routes/starter-app/starter-app-component.ts
with that content
import {Component, OnInit, ViewEncapsulation} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {LiveAppsService} from '@tibco-tcstk/tc-liveapps-lib';
import {GeneralConfig, TcCoreCommonFunctions} from '@tibco-tcstk/tc-core-lib';
import {Title} from '@angular/platform-browser';
import {Location} from '@angular/common';
@Component({
selector: 'app-starter-app',
templateUrl: './starter-app.component.html',
styleUrls: ['./starter-app.component.css'],
encapsulation: ViewEncapsulation.None
})
export class StarterAppComponent implements OnInit {
public config: GeneralConfig;
public logoUrl = TcCoreCommonFunctions.prepareUrlForStaticResource(this.location, 'assets/images/mylogo.svg');
constructor(private route: ActivatedRoute, private router: Router, private titleService: Title, private location: Location) { }
ngOnInit() {
// each route uses a resolver to get required data for any components it uses
// For example here the general config is read from this.route.snapshot.data.config
// That config is available because the starterApp route ran the GeneralConfigResolver when defined in case-route-config.ts
// *****
// case-route-config.ts:
// path: 'starterApp',
// component: StarterAppComponent,
// canActivate: [AuthGuard],
// resolve: {
// claims: ClaimsResolver,
// --> config: GeneralConfigResolver <-- *config* is this.route.snapshot.data.config below
// },
// children: STARTER_APP_ROUTES
this.config = this.route.snapshot.data.config;
this.titleService.setTitle(this.config.browserTitle ? this.config.browserTitle : 'Tibco Cloud Starters');
}
}
Basically,
Line 18, you need to create the variable logoUrl and assign it to an image
Line 20, add location to you constructor
Line 4, add the proper import to set the image path to the right location (that can differ where ever you test or deploy the app)
Line 6, add the proper import to get Location
Note :
- you might have to create the folder “images”
- you can find in here a mylogo.svg