mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
testeModals
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PreviewPhotoPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class PreviewPhotoPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewPhotoPageRoutingModule } from './preview-photo-routing.module';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
PreviewPhotoPageRoutingModule
|
||||
],
|
||||
declarations: [PreviewPhotoPage]
|
||||
})
|
||||
export class PreviewPhotoPageModule {}
|
||||
@@ -0,0 +1,15 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
<ion-icon></ion-icon>
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<img src="{{image}}" />
|
||||
<ion-footer>
|
||||
<ion-icon></ion-icon>
|
||||
<ion-icon></ion-icon>
|
||||
</ion-footer>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
describe('PreviewPhotoPage', () => {
|
||||
let component: PreviewPhotoPage;
|
||||
let fixture: ComponentFixture<PreviewPhotoPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PreviewPhotoPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(PreviewPhotoPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-preview-photo',
|
||||
templateUrl: './preview-photo.page.html',
|
||||
styleUrls: ['./preview-photo.page.scss'],
|
||||
})
|
||||
export class PreviewPhotoPage implements OnInit {
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private navParams:NavParams) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
image: any;
|
||||
|
||||
exit( ){ this.modalController.dismiss()
|
||||
|
||||
}
|
||||
save(img){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width=300
|
||||
canvas.height=234
|
||||
ctx.drawImage(img.attachments[0].image_url, 0, 0, 300, 234);
|
||||
document.body.appendChild(canvas);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user