0
我不知道爲什麼,但我有兩個重複的請求從我的控制器「AuditionCtrl」到數據庫。 請幫忙理解這個麻煩。AngularJS重複GET請求
在這裏你可以看到兩個GET請求 Github上我的項目https://[email protected]/vonoprienko/iknowit.git
我不知道爲什麼,但我有兩個重複的請求從我的控制器「AuditionCtrl」到數據庫。 請幫忙理解這個麻煩。AngularJS重複GET請求
在這裏你可以看到兩個GET請求 Github上我的項目https://[email protected]/vonoprienko/iknowit.git
重複:function called twice inside angularjs controller
這是您的audition.html
<div class="container-fluid fill" ng-controller="AuditionCtrl">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p>Welcome to exercise listening and typing!</p>
<br>
<button type="button" class="btn btn-default" ng-click="readbtn();">Play</button>
<br>
<input type="text" ng-model="userAnswer" placeholder="Type heard">
<button type="button" class="btn btn-default" ng-click="nextWord();">Next word</button>
<button type="button" class="btn btn-default" ng-click="skipWord();">Skip</button>
<br>
<label id="labelMessage" ng-bind="showCorrect"></label>
</div>
</div>
</div>
這是你的應用程序的一部分.js
.when('/audition', {
templateUrl: 'partials/audition.html',
controller: 'AuditionCtrl',
access: {
requiredLogin: false
}
正如答案中所述。您已將控制器連接到多個元素,從而導致控制器上的Angular調用摘要兩次。
謝謝,非常簡單的解決方案! –
您的回購是私人的 –
對不起,請等一秒鐘。請https://bitbucket.org/vonoprienko/iknowit/overview –