小编Ben*_*tes的帖子

从相机拍摄照片后图像没有刷新

我在ionic 2中使用此简单代码:

<button (click)="takePicture()" >Take a pic!</button>
<img [src]="url || '//:0'">
Run Code Online (Sandbox Code Playgroud)

这是我的Typescript页面:

import {Page} from "ionic-framework/ionic";

@Page({
    templateUrl: 'build/pages/smartscan/smartScan.html'
}
)

export class SmartScan {

public url:string;

constructor() {
    console.log("Starting SmartScan page ...");
}

public takePicture() {
    console.log("Going to take a pic ...");
    navigator.camera.getPicture( (imageURI) => {

        this.url = imageURI;

        console.log("URI of the picture taken is : "+this.url);

        console.log(JSON.stringify(this));

        //var image = document.getElementById('myImage');
        //image.src = imageURI;

    }, function (err) {
        console.log(JSON.stringify(err));
    }, {});

   /* this.url = "http://maison-cresci.fr/uploads/images/nice_cresci_slide_environnement_003.jpg";
*/
}

} …
Run Code Online (Sandbox Code Playgroud)

cordova ionic2 angular

5
推荐指数
1
解决办法
2054
查看次数

如何在 Go 中使用“类型”作为结构属性?

“type”是一个语言关键字,但我需要将它用作结构中的属性名称,例如:

type Message struct{
    type string
}
Run Code Online (Sandbox Code Playgroud)

我的 IDE 发现错误行 2

go

0
推荐指数
1
解决办法
648
查看次数

标签 统计

angular ×1

cordova ×1

go ×1

ionic2 ×1