如何在angular2中应用隐藏属性后隐藏消息

时间:2017-03-16 15:28:07

标签: html angular

我的html文件中有这段代码。

<div class="form-group"
    [ngClass]="{'has-error': (countryVar.touched || countryVar.dirty) && !countryVar.valid }">
    <label class="col-md-2 control-label" for="firstNameId">
        Country
    </label>
    <div class="col-md-8">
        <input class="form-control" 
            id="countryId" 
            type="text" 
            placeholder="Country (required)" 
            required 
            [(ngModel)]=customer.country
            name="country"
            #countryVar="ngModel" />
            <span class="help-block" [hidden]="countryVar.touched">           
                Please enter your country.
            </span>                           
        </div>
    </div>

基本上我想要达到的目标是,触及后的信息是真实的&#34;请输入您的国家&#34;被隐藏  我怎样才能做到这一点?

0 个答案:

没有答案