Search Posts

Author: Micha

Dependency injection in angular hybrid app (AngularJS & Angular 5)

I’ve got a problem with dependency injection in ngUpgraded AngularJS controller. I’d like to use toastr and Handlebars.js module in my hybrid app, but my every attempt to do it gives me erros (handlebars is necessary to handle external scripts from server side written long time ago, that’s why I need to use this some antipattern solution). The last script (providers) works only for jQuery usage. AngularJS controller: export const dataVisualization = { selector: ‘dataVisualizationNgJs’, […]

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’]; […]