Angularjs 如何将ng模型值更改为大写进行验证 国家

Angularjs 如何将ng模型值更改为大写进行验证 国家,angularjs,Angularjs,基于此字段,状态是必需的。但它可以是大写或小写,我怎样才能给它添加过滤器呢 <div class="form-group" ng-class="{'active': field == 'country', 'has-error has-feedback' :Country.$invalid && submitted}"> <label class="col-xs-2 control-label muted" for="Country">C

基于此字段,状态是必需的。但它可以是大写或小写,我怎样才能给它添加过滤器呢

 <div class="form-group" ng-class="{'active': field == 'country', 'has-error has-feedback' :Country.$invalid && submitted}">
        <label class="col-xs-2 control-label muted" for="Country">Country</label>
        <div class="col-xs-9">
            <input type="text" class="form-control" id="Country" name="Country" ng-change="ChangesMade()" ng-model="data.country" ng-readonly="previewMode" ng-focus="field='country';showHelp()" ng-required="contactPersonId">   
        </div>
    </div>

陈述
试试:

退房在第一个文本字段中键入“US”,在任何情况下都会进行排列,从而需要另一个文本字段(由红色背景表示)。
<div class="col-xs-4 pad-none" ng-class="{'has-error has-feedback' : (data.country =='US' || data.country =='CANADA' | uppercase) && State.$invalid && submitted }">
    <div class="col-xs-4" >
        <label class="control-label muted" for="State">State</label>
    </div>
    <div class="col-xs-8 pad-none">
        <input type="text" class="form-control" id="State" name="State" ng-change="ChangesMade()" ng-model="data.state" ng-readonly="previewMode" ng-focus="field='state';showHelp()" ng-required="data.country  =='US'  || data.country  =='Canada' ">
    </div>
</div>
ng-required="data.country.toUpperCase() === 'US' || data.country  =='Canada'"