Initial ng-model value not set in select

前端 未结 4 1245
庸人自扰
庸人自扰 2021-02-05 06:46

I have an enum (I code using TypeScript):

export enum AddressType
{
    NotSet = 0,

    Home = 1,
    Work = 2,
    Headquarters = 3,

    Custom = -1,
}
         


        
4条回答
  •  无人共我
    2021-02-05 07:17

    In a function if the below code is added and the same is called from the ng-init then the issue is also getting resolved. This will resolve the string comparison issue.

    $scope.Ctrl.type = "" + $scope.Ctrl.type + "";
    

提交回复
热议问题