Skip to content

Commit

Permalink
#115 added cart Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Aug 19, 2016
1 parent 55d64a2 commit bbf027a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
15 changes: 13 additions & 2 deletions app/vendor-details/vendor-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="text-center">{{vendor.name}}</h1>
<div>
<ul class="vendor-items">
<li class="vendor-item-list" *ngFor="let item of cat.itemlist">
<a>
<a (click)="openCartModal()">
<div>
<div class="name">{{item.item}}</div>
<div>{{item.price}}</div>
Expand All @@ -28,4 +28,15 @@ <h1 class="text-center">{{vendor.name}}</h1>
</ul>
</div>
</div>
</div>
</div>

<modal #cartModal class="modal_vcenter" [size]="sm">
<modal-header></modal-header>
<modal-body>
<div>
</div>
</modal-body>
<modal-footer>
</modal-footer>

</modal>
12 changes: 11 additions & 1 deletion app/vendor-details/vendor-details.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Component, OnInit } from "@angular/core";
import { Component, ViewChild, OnInit } from "@angular/core";
import { VendorDetailsService } from "./vendor-details.service";
import { MODAL_DIRECTIVES, ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal';


@Component({
selector: 'vendor-details',
templateUrl: 'app/vendor-details/vendor-details.component.html',
styleUrls: ['app/vendor-details/vendor-details.component.css'],
directives: [MODAL_DIRECTIVES, ModalComponent],
providers: [VendorDetailsService]
})

Expand All @@ -21,5 +23,13 @@ export class VendorDetailsComponent implements OnInit {
constructor(private vendorDetailsService: VendorDetailsService){

}
@ViewChild('cartModal')
cartModal: ModalComponent;
openCartModal(){
this.cartModal.open();
}
closeCartModal(){
this.cartModal.close();
}

}

0 comments on commit bbf027a

Please sign in to comment.