import { Component, OnInit } from '@angular/core'; import { MyCameraService } from '../../services/my-camera-service'; @Component({ selector: 'ns-camera-button', templateUrl: './camera-button.component.html', styleUrls: ['./camera-button.component.css'], moduleId: module.id, }) export class CameraButtonComponent implements OnInit { camera:MyCameraService = new MyCameraService(); constructor() { } ngOnInit() { } onTap() { this.camera.takePicture().then( (res) => {console.log(res)}, () => {} ); } }