Search Posts

Author: Micha

Create controllers in ng-repeat directive

I am trying to refactor my AngularJS code. My goal is to create dynamically controllers responsible for view of data from REST API. My idea is to use ng-repeat directive and inside it create div with ng-controller directive with parameter from ng-repeat output. Unfortunatelly I don’t know how to pass data to single iteration. AngularJS code (function () { ‘use strict’; angular .module(‘App’) .controller(‘ActionData’, ActionData); ActionData.$inject = [‘$scope’, ‘AlertService’, ‘$http’, ‘taskId’, ‘$state’, ‘$timeout’, ‘$uibModal’, ‘toastr’]; […]