Как создать директиву в angularjs, которая, например, принимает этот элемент:
<div>Example text http://example.com</div>
И преобразуйте его в это
<div>Example text <a href="#" onclick="location.href='http://example.com'; return false;">http://example.com</a></div>
У меня уже есть функциональность, написанная для автоматической ссылки на текст в функции и возврата html (позвольте вызывать функцию autoLink), но я не могу поцарапать свои директивы.
Я также хотел бы добавить атрибут к элементу, чтобы передать объект в директиву. например.
<div linkprops="link.props" >Example text http://example.com</div>
Если link.props является объектом типа {a: 'bla bla', b: 'waa waa'}, который должен быть передан функции autoLink в качестве второго параметра (первым был текст).