Skip to content

Commit

Permalink
added a "hello" component that opens a pop over
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Ovide authored and Sebastian Ovide committed Jun 15, 2017
1 parent fc384b5 commit fac2ae3
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/components.module.ts
Expand Up @@ -3,9 +3,14 @@ import { MusicCardComponent } from './music-card/music-card'
import { MusicItemComponent } from './music-item/music-item'
import {IonicModule} from 'ionic-angular'
import { PipesModule } from '../pipes/pipes.module'
import { PopoverModule } from './popover/popover.module'
import { PopoverComponent } from './popover/popover'
import { HelloComponent } from "./hello/hello";

@NgModule({
declarations: [MusicCardComponent, MusicItemComponent],
imports: [PipesModule, IonicModule],
exports: [MusicCardComponent, MusicItemComponent]
declarations: [MusicCardComponent, MusicItemComponent, HelloComponent],
imports: [PipesModule, IonicModule, PopoverModule],
exports: [MusicCardComponent, MusicItemComponent, HelloComponent],
entryComponents: [PopoverComponent]
})
export class ComponentsModule { }
3 changes: 3 additions & 0 deletions src/components/hello/hello.html
@@ -0,0 +1,3 @@
<a (click)="openPopover()">
Click me to see a popover
</a>
3 changes: 3 additions & 0 deletions src/components/hello/hello.scss
@@ -0,0 +1,3 @@
hello {

}
15 changes: 15 additions & 0 deletions src/components/hello/hello.ts
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { PopoverComponent } from '../popover/popover'
import { PopoverController } from 'ionic-angular';
@Component({
selector: 'hello',
templateUrl: 'hello.html'
})
export class HelloComponent {
constructor(private popoverCtrl: PopoverController) {
}

openPopover() {
this.popoverCtrl.create(PopoverComponent).present();
}
}
10 changes: 10 additions & 0 deletions src/components/popover/popover.module.ts
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { PopoverComponent } from './popover'

@NgModule({
declarations: [ PopoverComponent],
imports: [ ],
exports: [PopoverComponent],
entryComponents: [PopoverComponent],
})
export class PopoverModule { }
5 changes: 5 additions & 0 deletions src/components/popover/popover.ts
@@ -0,0 +1,5 @@
import { Component } from '@angular/core';
@Component({
template: '<h1>Hello</h1>'
})
export class PopoverComponent {}
1 change: 1 addition & 0 deletions src/pages/home/home.html
Expand Up @@ -14,4 +14,5 @@
<ion-content padding>
<music-item navPush="DetailPage" *ngFor="let track of tracks" [navParams]="{'track': track}" [track]="track"></music-item>
<button ion-button block logEvnt>Tap me and check the console</button>
<hello></hello>
</ion-content>

0 comments on commit fac2ae3

Please sign in to comment.