小编Hot*_*mit的帖子

ng-select 未在 Angular 2 中更新

你好,我是 angular 2 的新手

我可以在 ng-select 控件中添加 formGroup 并预定义添加值。

那是完美的。但是当按钮单击然后新值推送 ng-select 但 ng-select not updates 。

这是我的笨蛋

https://plnkr.co/edit/Hwfk1T2stkiRcLTxuFmz

//our root app component
import {Component, OnInit, NgModule, ViewChild} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';
import {SelectModule} from 'ng-select';

@Component({
    selector: 'my-app',
    template: `
<h1>ng-select demo app</h1>
<form style="padding:18px;max-width:800px;"
    [formGroup]="form">

    <div style="margin:5px 0;font-weight:600;">Single select example</div>
    <ng-select
          [options]="options0"
          [multiple]="false"
          placeholder="Select one"
      formControlName="selectSingle"
     >
    </ng-select>

   <button (click)="pushValue()">Click</button>



    <div>Events:</div>
    <pre #preSingle>{{logSingleString}}</pre>

</form>`
})
export class App implements OnInit { …
Run Code Online (Sandbox Code Playgroud)

javascript angular-ngselect angular

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

所有Yii2控制器都不允许在没有登录的情况下执

我正在使用Yii2 Advance应用程序,我是yii2的新手,所以如何制作

所有yii2控制器不允许在没有登录的情况下进行操作或者客人必须登录

我的意思是如果用户没有登录就无法登录控制器,所以在登录页面重定向这不是一个控制器我需要很多控制器

yii2

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

标签 统计

angular ×1

angular-ngselect ×1

javascript ×1

yii2 ×1