角度无线电的问题

时间:2015-11-30 09:56:46

标签: javascript angularjs

我有角度的无线电按钮的问题。 ng-change指令似乎没有运行。关于元素变化的事件有效。

HTML代码

<div class="radio" ng-repeat="app in appUsed">
            <label for="<% app %>">
                <input type="radio"
                       id="<% app %>"
                       name="app"
                       ng-change="$parent.clear()"
                       ng-value="<% app %>"
                       ng-model="$parent.results['psi']['app_version']">
                <% app %>
            </label>
        </div>
        <div class="radio">
            <label>
                <input type="radio"
                       id="other"
                       name="app"
                       ng-value='other'
                       ng-model="results['psi']['app_version']"
                       ng-change="enableOther()}"
                       > Other:
                <input type ='text' id="otherAppValue" ng-model="otherRadioValue" ng-disabled="!otherRadioFlag">
            </label>
        </div>

角括号替换为&lt; %%&gt;因为我和laravel一起工作。

这是JS片段。如果按钮改变,我希望他们控制。

$scope.clear = function () {
// $scope.clear = function() {
    console.log('lalala');
   // $scope.otherRadioFlag = false;
  //  $scope.otherRadioValue = "";
}
$scope.enableOther = function() {

    console.log('ssadasds');
 //   $scope.otherRadioFlag = true;
   // console.log($scope.otherRadioFlag);
}

任何人都可以帮助我吗?

0 个答案:

没有答案