How to check if value is number

后端 未结 3 701
陌清茗
陌清茗 2021-01-04 04:24

I have this function :

 $scope.SearchTicketEvent = function (ticketPinOrEvent)
            {
                if (ticketPinOrEvent != undefined)
                      


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 05:07

    In Angular 6 this works without using any prefix.

    Example:

    if(isNumber(this.YourVariable)){
        // your Code if number
    }
    else {
        // Your code if not number
    }
    

提交回复
热议问题