V
V
Vyacheslav Lebedev2014-12-08 16:24:35
Angular
Vyacheslav Lebedev, 2014-12-08 16:24:35

How to implement object selection on click in angular js?

How to use the ui.router module to implement selection (visually change the color, for example) of an object (text in the a tag) on ​​click?
Please provide an easy example :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Romanov, 2014-12-09
@slavikse

It is not entirely clear what is meant by selection, and what is meant by an object. Is the object an HTML element or a word in text? Well, here's the preview.
In template.
In code

$scope.select = function($event) {
      angular.element($event.target).addClass('badge');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question