javascript - Fire event on repeat done in AngularJS -
hello trying fire event on repeat done in angularjs, following code:
following html code
<li ng-repeat="y in names | limitto: 6" repeat-done="ratingwithng()"> <a href="<?php echo $this->config->item('search_url');?>{{y.hosurl}}"> <div class="hospital-card"> <img src="{{y.profile_image}}" width="" height="" /> <h3 class="vlcc-name">{{y.clinic_name}}</h3> <div class="doc-rete"> <div id="rateyo-hos" class="mc-doc-rating">3</div> </div> <p class="hospital-specialist">{{y.localty }} {{y.city }}</p> <p class="vlcc-experince">{{y.clinic_type }}</p> <p class="vlcc-address">{{y.hos_time }} </p> </div> </a> </li>
following angularjs code:
var app = angular.module('myapp', []); app.controller('customersctrl', function($scope, $http) { $http.get("frontendapi/hospital_list") .then(function (response) {$scope.names = response.data.hospitallist;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namesnews = response.data.newslistfeature;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namesnewsrec = response.data.newslist;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namedoctor = response.data.records;}); $http.get("frontendapi/people_list") .then(function (response) {$scope.namedoctorshift = response.data.peoplelist;}); $http.get("frontendapi/interviews_list") .then(function (response) {$scope.nameinterview = response.data.interviewslist;}); }); function ratingwithng() { alert(); }
alert not working, please suggest.
thanks
your function must 1 $scope
object controller visible on ng-repeat
var app = angular.module('myapp', []); app.controller('customersctrl', function($scope, $http) { $http.get("frontendapi/hospital_list") .then(function (response) {$scope.names = response.data.hospitallist;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namesnews = response.data.newslistfeature;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namesnewsrec = response.data.newslist;}); $http.get("frontendapi/newslist") .then(function (response) {$scope.namedoctor = response.data.records;}); $http.get("frontendapi/people_list") .then(function (response) {$scope.namedoctorshift = response.data.peoplelist;}); $http.get("frontendapi/interviews_list") .then(function (response) {$scope.nameinterview = response.data.interviewslist;}); $scope.ratingwithng = function () { alert(); } });
Comments
Post a Comment