嗨我有一个功能,它会在http请求到服务器后更新.似乎console.log显示该值已更新但UI未更新,除非我单击任何其他组件(例如输入).
这是我的功能:
fileTransfer.upload(this.created_image, upload_url, options)
.then((data) => {
console.log("success:"+data.response); //This is showing correct response
var obj = JSON.parse(data.response);
this.sv_value = obj.value;
console.log(this.sv_value); //This is showing correct value
}, (err) => {
console.log("failure:");
})
Run Code Online (Sandbox Code Playgroud)
这是我的观点html:
<ion-row>
<ion-col center width-100 no-padding>
<h2>{{sv_value}}</h2> //This is not updated
</ion-col>
</ion-row>
Run Code Online (Sandbox Code Playgroud)
有什么办法可以解决这个问题吗?谢谢
我正在使用ionicv2和Adobe Creative SDK构建照片编辑应用程序.我已经成功实施了创意SDK.
在CSDK成功返回已编辑文件的URL后,我将包含段的页面与文件URL一起推送.
问题出在第二页,当我点击该段时,它不会切换.只有在我点击页面内的输入时才会切换.
我尝试在没有CSDK的情况下进行操作,它运行没有任何问题.
我的代码:
loadCamera(sourceType){
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: sourceType
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64:
let base64Image = 'data:image/jpeg;base64,' + imageData;
var thisModule = this;
function success(newUrl) {
console.log("Success Editing!", newUrl);
thisModule.goToCreate(newUrl);
}
function error(error) {
console.log("Error!", error);
}
/* Optional `options` object. See API guide for usage. */
var options = …
Run Code Online (Sandbox Code Playgroud) 我有一个从Access数据库导出的Excel文件.
我有25000
记录,我需要更换所有记录.
日期列未格式化(yymmdd).我需要将日期格式从yymmdd更改为dd/mm/19yy.因为yy
我需要19
在它前面添加一个常量值,这样就可以了19yy
.
我每行只有1个日期列
有没有办法将所有转换25000
的格式记录的列yymmdd
到dd/mm/19yy
点击几下?谢谢
我点击一个按钮后会出现一个元素.我现在想要的是当鼠标指针离开元素时隐藏元素.怎么可能?谢谢
JS脚本:
$(document).ready(function() {
$('.hide').hide();
$('.button').click(function() {
$(this).closest('div').find('.hide').toggle(400);
return false;
});
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<a class="button" >More</a>
<div class="hide" ><img src="images/icon.png" /></div>
//I want this div hide element to hide after my mouse pointer leave this div area
Run Code Online (Sandbox Code Playgroud)
非常感谢你:D
我正在构建一个移动应用程序来显示新闻源.在我的应用程序中,应该能够发布状态.
状态将使用POST方法发送到PHP服务器.
现在我的问题是PHP无法读取我使用angular2发送的POST请求.
这是我的代码:
form.html
<form class="sample-form post-form" [formGroup]="post_form" (ngSubmit)="createStatus()">
<ion-item>
<ion-textarea rows="7" placeholder="What's happening?'" formControlName="status"></ion-textarea>
</ion-item>
<section class="form-section">
<button ion-button block class="form-action-button create-post-button" type="submit" [disabled]="!post_form.valid">Post</button>
</section>
</form>
Run Code Online (Sandbox Code Playgroud)
form.ts
import { Component } from '@angular/core';
import { NavController, AlertController } from 'ionic-angular';
import { Validators, FormGroup, FormControl } from '@angular/forms';
import { Http, Headers } from '@angular/http';
import 'rxjs/add/operator/map';
@Component({
selector: 'form-page',
templateUrl: 'form.html'
})
export class FormLayoutPage {
section: string;
post_form: any;
url: string;
headers: Headers;
constructor(public nav: NavController, …
Run Code Online (Sandbox Code Playgroud) 这是我的密码加密代码:
// Create a 256 bit (64 characters) long random salt
// Let's add 'something random' and the username
// to the salt as well for added security
$salt = hash('sha256', uniqid(mt_rand(), true) . 'something random' . strtolower($username));
// Prefix the password with the salt
$hash = $salt . $password;
// Hash the salted password a bunch of times
for ( $i = 0; $i < 100000; $i ++ )
{
$hash = hash('sha256', $hash);
}
// Prefix the hash …
Run Code Online (Sandbox Code Playgroud)