Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 2fe1209

Browse files
feat(feature-discovery): add classes input to feature directive
1 parent a6bd38c commit 2fe1209

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

projects/core/src/lib/feature-discovery/feature-discovery.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
ElementRef,
88
Renderer2,
99
Output,
10-
EventEmitter
10+
EventEmitter,
11+
HostBinding
1112
} from '@angular/core';
1213
import {
1314
AnimationEvent,
@@ -66,6 +67,7 @@ export class FivFeatureDiscovery implements OnInit, AfterContentInit {
6667
contentOffset = 0;
6768
bounds: FeaturePosition;
6869
icon: string;
70+
classes: string[];
6971
@ViewChild('circle', { static: true }) circle: ElementRef;
7072
@ViewChild('rect', { static: true }) rect: ElementRef;
7173
@ViewChild('pInner', { static: true, read: ElementRef })
@@ -81,6 +83,10 @@ export class FivFeatureDiscovery implements OnInit, AfterContentInit {
8183
@Output() fivOpen = new EventEmitter<any>();
8284
@Output() fivAnimation = new EventEmitter<AnimationEvent>();
8385

86+
@HostBinding('class') get _classes() {
87+
return this.classes.join(' ');
88+
}
89+
8490
constructor(private renderer: Renderer2, private platform: Platform) {}
8591

8692
ngOnInit() {}

projects/core/src/lib/feature-discovery/feature.directive.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class FivFeature {
2727
@Input() contentOffset = 20;
2828
@Input() featurePadding = 20;
2929
@Input() clickEnabled = true;
30+
@Input() classes: string[] = [];
3031
@Input() fivFeature: TemplateRef<any>;
3132
overlayRef: ComponentRef<FivFeatureDiscovery>;
3233

@@ -73,6 +74,7 @@ export class FivFeature {
7374
featureOverlay.width = this.diameter;
7475
featureOverlay.featurePadding = this.featurePadding;
7576
featureOverlay.contentOffset = this.contentOffset;
77+
featureOverlay.classes = this.classes;
7678
featureOverlay.setIcon(icon);
7779
featureOverlay.setBounds(bounds);
7880
featureOverlay.show();

src/app/pages/feature-discovery/feature-discovery.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
4141
<ion-fab-button color="primary" (click)="log('FAB Clicked')">
4242
<!-- use the fiv-icon for cool icon effect -->
43-
<fiv-icon #fab="fivFeature" [fivFeature]="fabContent" [featurePadding]="fp" [contentOffset]="co" name="add"
43+
<fiv-icon [classes]="['cool','classes']" #fab="fivFeature" [fivFeature]="fabContent" [featurePadding]="fp" [contentOffset]="co" name="add"
4444
(fivFeatureClick)="log('feature click')" (fivWillOpen)="log('fiv will open')" (fivOpen)="log('fiv open')"
4545
(fivWillClose)="log('fiv will close')" (fivClose)="log('fiv close')">
4646
</fiv-icon>

0 commit comments

Comments
 (0)