File

lib/common/src/home/home.page.ts

Metadata

Index

Properties
Accessors

Constructor

constructor(entries: HomePageEntries, notificationService: NotificationService)
Parameters :
Name Type Optional
entries HomePageEntries No
notificationService NotificationService No

Properties

Public entries
Type : HomePageEntries
Default value : []
Decorators :
@Optional()
Public notificationService
Type : NotificationService

Accessors

activeEntries
getactiveEntries()
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>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""