lib/common/src/home/home.page.ts
selector | rcc-home |
templateUrl | home.page.html |
Properties |
|
Accessors |
constructor(entries: HomePageEntries, notificationService: NotificationService)
|
|||||||||
Defined in lib/common/src/home/home.page.ts:15
|
|||||||||
Parameters :
|
Public entries |
Type : HomePageEntries
|
Default value : []
|
Decorators :
@Optional()
|
Defined in lib/common/src/home/home.page.ts:19
|
Public notificationService |
Type : NotificationService
|
Defined in lib/common/src/home/home.page.ts:20
|
activeEntries |
getactiveEntries()
|
Defined in lib/common/src/home/home.page.ts:25
|
import { Component,
Optional,
} from '@angular/core'
import { sortByKeyFn } from '@rcc/core'
import {
HomePageEntries,
} from './home.commons'
import { NotificationService } from '../notifications'
import { Action } from '../actions'
@Component({
selector: 'rcc-home',
templateUrl: 'home.page.html',
})
export class HomePageComponent {
constructor(
@Optional()
public entries : HomePageEntries = [],
public notificationService : NotificationService,
) {
this.entries = entries || []
}
get activeEntries(): Action[] {
return this.entries
.filter(
(action: Action) => typeof action.position == 'function'
? ['number', 'undefined'].includes(typeof action.position() )
: ['number', 'undefined'].includes(typeof action.position )
)
.sort( sortByKeyFn('position') )
}
}
<rcc-full-page>
<header class ="ion-padding">
<h1
class ="ion-text-center"
[id] = "'APP_NAME' | toID:'rcc-e2e'"
>
{{ 'APP_NAME' | translate }} – {{ 'APP_NAME_ADD_ON' | translate }}
</h1>
<h2
class ="ion-text-center"
[id] = "'TESTING' | toID:'rcc-e2e'"
>
{{ 'TESTING' | translate }}
</h2>
</header>
<section>
<ion-list>
<rcc-action-button
*ngFor = "let action of activeEntries"
[action] = "action"
></rcc-action-button>
</ion-list>
</section>
<footer class = "ion-padding">
🐈 {{ 'APP_NAME' | translate }} – {{ 'APP_NAME_ADD_ON' | translate }}
</footer>
</rcc-full-page>