A
A
Anton2015-12-24 12:47:08
Angular
Anton, 2015-12-24 12:47:08

How to make a directive out of this simple ng-repeat?

There is a very simple code, an example is here codepen.io/anon/pen/obLqvP?editors=101
In another place of the application, it was necessary to insert exactly the same functionality, I wanted to write a directive, and I realized that I could not find a simple and concise solution, my directives are up to did not write this, who can help?
I would like the code to remain approximately the same, without wild crutches with angular.element(...) and other things, like digging in the direction of the directive controller, but I still don’t quite understand how to use it correctly, and what the template should be in that case...
PS something like this should look like a directive<inputs-block inputs="vm.inputs">

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2015-12-24
@brud

I asked it myself - I answered it myself codepen.io/anon/pen/YwGGYW?editors=101
PS No, I got excited - this is closer, but if you use it in the same controller a second time, then the variables are frayed...

K
Kerim Berdimyradov, 2015-12-24
@berdimuradov

It's all right????
codepen.io/anon/pen/qbaaBG?editors=101

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question