小编vma*_*cek的帖子

完成所有上传后的FineUploader客户端事件

我实现了FineUploader,我希望在上传所有文件后将我的客户端脚本连接到一个事件.那可能吗?

我的实现如下.只是想知道这是否是正确的方向.

    function init() {
    var uploader = new qq.FineUploader({
        element: document.getElementById('button-selectfiles'),
        request: {
            endpoint: '/Up/UploadFile'
        },

        callbacks: {
            onStatusChange: onFileUploadStatusChange
        }
    });
};

var uploads = 0;
function onFileUploadStatusChange(id, oldStatus, newStatus) {
    console.log(newStatus);

    if (newStatus === 'submitting') {
        uploads++;
    }

    if (newStatus === 'upload successful' || newStatus === 'upload failed') {
        uploads--;
    }

    if (uploads === 0) {

        console.log('done');
    }
}
Run Code Online (Sandbox Code Playgroud)

javascript fine-uploader

3
推荐指数
2
解决办法
5658
查看次数

用于braintree.dropin v3 类型的角度类型

我正在将 Braintree Drop-in v3 集成到带有 package 的 angular 应用程序中 npm i -save braintree-web-drop-in

然后我发现@types/braintree-web我正在遵循此处提到的示例的包但它似乎不包含对 Drop-in 功能的支持。显然,这不是正确的包。

braintree.dropin.create({
  authorization: environment.braintreeKey,
  selector: '#dropin-container'
}, function (err, dropinInstance) {
  if (err) {
    // Handle any errors that might've occurred when creating Drop-in
    console.error(err);
    return;
  }
  submitButton.addEventListener('click', function () {
    dropinInstance.requestPaymentMethod(function (err, payload) {
      if (err) {
        // Handle errors in requesting payment method
      }

      // Send payload.nonce to your server
    });
  });
});
Run Code Online (Sandbox Code Playgroud)

我有进口声明 import * …

braintree typescript-typings

3
推荐指数
1
解决办法
1301
查看次数

在 mat-form-field 角材料内有多个输入

我想要实现的目标可以在下图中看到。

在此处输入图片说明

或堆叠闪电战

https://angular6-material-components-demo-etqohr.stackblitz.io/

我使用 angular material 作为 UI 框架

问题是当我点击任何地方(日、月或年)时,焦点会自动放在第一个输入上。我无法在文档中找到如何禁用此行为。

另一个问题是验证,整个字段的验证只会考虑第一个字段。感觉这不是由角材料支持的。关于如何解决这个问题的任何想法?

模板标记:

<mat-form-field class="full-width">
  <mat-label>{{label}}</mat-label>
  <div class="d-flex justify-content-between">
    <div>
      <input matInput name="day" #day="ngModel" [(ngModel)]="dateOfBirthDay" type="tel" inputmode="numeric"
        autocomplete="nope" placeholder="24" required maxlength="2" (keypress)="validate($event)">
    </div>
    <div>
      <input matInput name="month" [(ngModel)]="dateOfBirthMonth" type="tel" inputmode="numeric" autocomplete="nope"
        placeholder="12" required maxlength="2" (keypress)="validate($event)">
    </div>
    <div>
      <input matInput name="year" [(ngModel)]="dateOfBirthYear" type="tel" inputmode="numeric" autocomplete="nope"
        [placeholder]="placeholderYear" required maxlength="4" (keypress)="validate($event)">
    </div>
  </div>
  <mat-error>
    {{_errorMessage}}
  </mat-error>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)

angular-material angular

3
推荐指数
1
解决办法
2304
查看次数

VSO CI - 无论我做什么,ASPNETCORE_ENVIRONMENT都会设置为Production

我正在VSO中创建我的CI管道,我有.net核心应用程序,我创建了端点,告诉我在发布期间使用了哪个值,IHostingEnvironment.EnvironmentName通过API 公开,无论我做什么,它都设置为Produciton.我的应用程序托管在Azure中.

我做的步骤 -

我研究了Azure App Service的应用程序设置,寻找环境.想想可能会在Release配置中覆盖我的变量.

ASPNETCORE_ENVIRONMENT在发布配置中设置变量选项卡上的变量,我也在特定环境中设置它.

在环境中设置它: 在此输入图像描述 在此输入图像描述

在发布配置上设置它: 在此输入图像描述

我也setx用参数破坏了命令ASPNETCORE_ENVIRONMENT "Test".

setx命令

以上都没有任何区别,当我查询我的端点时,我回来了,我正在运行Production环境.任何帮助深表感谢.

azure-pipelines

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

具有管理历史的Angular 6+自定义后退导航

浏览器的历史记录有以下问题.

我在我的应用程序中点击了按钮然后我 this._router.navigate([...哪个是错的,因为我在历史页面中我和我导航的页面一样.然后当用户点击本机后退按钮时,他在错误的页面上结束.

我改成了

this.location.replaceState('xxx');
this.router.navigate(['/xxx'], { skipLocationChange  : true });
Run Code Online (Sandbox Code Playgroud)

这只是技巧的一半,因为当我在应用程序中使用后退按钮时,我导航到页面,当我使用本机后退按钮时没有任何反应,因为我有两次.

我知道如何从历史中删除另一个州?

angular

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