AngularJS: How to set default value to ng-model=“searchText”?

后端 未结 5 1720
遥遥无期
遥遥无期 2020-12-29 07:02

I am unable to set a default value to ng-model=\"searchText\". Here is the code I am using
<

5条回答
  •  独厮守ぢ
    2020-12-29 07:26

    Try this following code:

         
    

    In your controller

        $scope.searchText = "your default value";
    

    Edit : If you don't want to initialize the default value in controller just do

          
    

提交回复
热议问题