7
votes
2answers
3k views

AngularJS call method in directive controller from other controller

I am trying to figure this one out but it seems google is not my friend today so I'm going to ask you guys here. Basically I have a directive that has its own controller. See the below code: var ...
7
votes
2answers
214 views

When to write a directive?

Angular provides us with a mechanism to write directives - which is extremely powerful in what it can do. But the thing I keep wondering is - in what scenario should you be actually writing a custom ...
6
votes
1answer
100 views

Directives callbacks and scope

I'm trying to wrap my head around scopes in angularjs, particularly when it comes to invoking callbacks on the module that is using a directive. I've found 3 different ways to accomplish the same ...
6
votes
1answer
604 views

AngularJS directives - best practices when using ngModel with jQuery widget

Here is my problem. For example, we have the following directive, which uses some jQuery widget behind the scenes : module.directive('myWidget', [function() { return { require: ...
6
votes
1answer
1k views

AngularJS file drag and drop in directive

This example does pretty much what I would like to port in Angular-js: HTML5 File API. I have been trying to google some example of directives however I found old example that do massive use of DOM ...
5
votes
1answer
452 views

Wrapping Foundation 4 reveal in Angular

New to Angular, just trying to get some harmony with Zurb Foundation 4. A case in point; I am trying to make use of the http://foundation.zurb.com/docs/components/reveal.html component. ...
4
votes
1answer
601 views

How to observe custom events in AngularJS?

Simple example: I have a textarea and want to provide additional behavior to it: do something on enter key and go to next line on shift + enter I suppose that I should provide additional directive to ...
4
votes
1answer
505 views

How do I $watch multiple interpolated attributes in a directive?

I don't understand how to watch multiple attributes at the same time in the link function, so I create an object with all the parameters and I watch for it. But I noticed that the attribute in the ...
3
votes
2answers
300 views

AngularJS DOM selector

I've got a few custom directives that use jQuery for animation effects (angular's built-in ngShow/ngHide and the like are functional, but not pretty). I think I remember reading in the documentation ...
3
votes
2answers
60 views

How to expose behavior from directive with isolated scope?

How can I expose a method from directive? I know that I should use attributes for data, but I really want to expose behavior, not data. Something that the parent controller can call. Let's say my DOM ...
3
votes
1answer
351 views

How to create a custom input type in Angular.js?

I'm new to Angular.js and would like to create a custom input type similar to the way angular.js implements "email", for example. <input type="email" ng-model="user.email" /> What I would ...
3
votes
1answer
343 views

AngularJS/jQuery: changing text in span doesn't fire resize event

I'm having trouble getting jQuery's resize event to fire on a span, after I've changed the text inside the span. I'm applying the event handlers to the span element using an AngularJS directive: ...
3
votes
1answer
913 views

Angularjs error Unknown provider

I'm trying to display the configured values author and version in angular value service in html page.Version code is displayed fine but not the author name Here is the html code <!doctype ...
3
votes
1answer
246 views

AngularJS: multiple directives with transclusion on same element

I'm trying to inject 2 templates into an element and operate on them: <div ic-first="foo" ic-second="bar" ic-third="baz" ic-fourth="qux" > </div> icFirst should inject via a ...
3
votes
1answer
161 views

Angular Directive - how to setup bi-diectional binding with ng-model

I wrote a directive for redactor (a wysiwyg editor). It works after some hacking but I would like find out the right way. The main challenge for me is the bi-directional binding between the ng-model ...

1 2 3 4 5 11
15 30 50 per page