小编Coz*_*ure的帖子

我可以禁用 sweet Alert js 按钮吗?

我想禁用甜蜜警报中显示的按钮,以便我的用户无法一次又一次单击该按钮。我已在此处附上警报的屏幕截图

我想禁用确认按钮(我不希望关闭警报):

swal({
    title: "Are you sure?",
    text: "You want to add this discount?",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Continue",
    cancelButtonText: "Cancel",
    closeOnConfirm: false,
    closeOnCancel: false
}, function (isConfirm) {
    if (isConfirm) {
        document.getElementById('message_error_new_discount').innerHTML = '';
        $.post('./CURL/addNewDiscount.php', JSON.stringify({
            "code": discount_code_newDiscount,
            "percentage": percentage_newDiscount,
            "startDate": sdate_newDiscount,
            "endDate": edate_newDiscount
        }), function (data) {
            var text = "your discount code is " + data.code;
            swal({ title: "Discount Added!", text: text, type: "success" }, function () {
                window.location = './discountlist.php';
            }); …
Run Code Online (Sandbox Code Playgroud)

javascript jquery sweetalert

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

角度2:如何在md-list-item中传递路由器?

我正在使用填充对象列表md-nav-list。当用户单击时md-list-item,我想导航到候选详细路由器,并将其传递给candidate.id它。

不知道如何在上呼叫路由器md-list-item

  <md-nav-list *ngFor="let candidate of candidates">
    <md-list-item class="candidate-row">
      <div class="column2">
        <span class="name">{{candidate.name}},</span>
      </div>
    </md-list-item>
  </md-nav-list>
Run Code Online (Sandbox Code Playgroud)

候选人详细信息的路由器是
{path: 'candidate/:id', component: CandidateDetailsComponent}

其余代码可以在这里找到 https://github.com/himanshuy/hiringplus-ui/tree/page2

angular-material angular

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

翻译离子选择的确定和取消按钮的文本

我想将 ionic ion-select 的确定和取消按钮翻译成当地语言。这两个OKCANCEL按钮应该被翻译。谁能指导我如何做到这一点?

图片

ionic-framework

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

如何在ngrx效果中进行http轮询

我有这种效果,我正在尝试使用计时器每x秒轮询一次数据。但是我不知道计时器应该如何与数据流交互。我尝试在顶部添加另一个switchMap,但随后无法将操作和有效负载传递给第二个switchmap。有任何想法吗?

我看了这篇文章,但情况有所不同。我正在通过需要访问的操作传递有效负载,并且正在使用ngrx 6。

@Effect()
getData = this.actions$
    .ofType(appActions.GET_PLOT_DATA)
    .pipe(
        switchMap((action$: appActions.GetPlotDataAction) => {
            return this.http.post(
                `http://${this.url}/data`,
                action$.payload.getJson(),
                {responseType: 'json', observe: 'body', headers: this.headers});
        }),
        map((plotData) => {
            return {
                type: appActions.LOAD_DATA_SUCCESS,
                payload: plotData
            }
        }),
        catchError((error) => throwError(error))
    )
Run Code Online (Sandbox Code Playgroud)

http rxjs ngrx ngrx-effects angular

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

错误TS1128 Build:在Angular 2中预期的声明或语句

我已经将asp.net core 1.0的依赖关系更新为asp.net core 1.1。使用nuget管理器。我已更新了nuget更新中上传提及的所有列表。现在,我收到错误TS1128 Build:Declaration或期望的语句。我,有一些谷歌,发现我正在使用旧的类型脚本。我已经从此链接https://blogs.msdn.microsoft.com/typescript/2016/09/22/announcing安装了最新版本的类型脚本-typescript-2-0 /

tsc版本

Visual Studio不断向我显示错误。如何在角度2中解决此问题。

更新后,在此行代码中出现错误才可以。

LoadMarketItem(page : number) {
        this._pagination = [];
        this.DashBoardservice.GetMarketListCall(page).subscribe(
            data => {
                this.listMarket = data; 
                for(var i = 1; i <= this.listMarket.totalPage; i++){
                    this._pagination.push(new PaginationViewModel(i));
            },    --> getting errror here
            err => { console.log(err); });
    }
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc visual-studio asp.net-core angular

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