please help me, I would like to access a function using ng-click like this :
<tr ng-repeat="data in listtalentapegawai">
<td>
{{data.nip}}
</td>
<td>
{{data.nama}}
</td>
<td>
{{data.tgl_grade_terakhir}}
</td>
<td>
{{data.sem1_2012}}
</td>
<td>
{{data.sem2_2012}}
</td>
<td>
{{data.sem1_2013}}
</td>
<td>
{{data.sem2_2013}}
</td>
<td>
{{data.sem1_2014}}
</td>
<td>
{{data.sem2_2014}}
</td>
<td>
{{data.sem1_2015}}
</td>
<td>
<button ui-sref=".modal" ng-click="showAlert(data.nip)">Simulasi</button>
</td>
</tr>
data.nip come from ng-repeat="data in listtalentapegawai"
and this is the state I wrote :
.state('masterpegawai.alltalenta.modal', {
url: '/modal',
views:{
"modal": {
templateUrl : 'public/js/modal.html',
controller: 'simulate'
}
}
})
angular.module('routerApp').controller('simulate', ['$scope', function ($scope) {
$scope.showAlert = function (provider) {
//console.log('clicked signin ' + provider);
$scope.nip = provider;
}
$scope.showAlert();
}])
The problem is provider doesn't have value. Actually I woul like to pass the data.nip from showAlert(data.nip) to a modal dialog
ui-sref
, do you want to change state and show alert dialog? – MrNobody Feb 24 '16 at 4:06