E
E
Elder122015-06-06 23:48:42
Angular
Elder12, 2015-06-06 23:48:42

How to add tag on event in angularjs?

Good.
Tell me please.
There is a block with forms, by pressing a button a new field should be added to the form, and at the end. How to implement it?
Google mostly talks about directives, but there are not quite the examples that are needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentin Dubrovsky, 2015-06-07
@Elder12

In template:

<div ng-repeat='input in inputs'>
    <label>input.label</label>
    <input type='text' />
</div>

In controller:
var inputs = [
    {label: 'Пароль'} // каждый элемент в массиве это объект с настройками для инпута.
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question