48
votes
3answers
3k views

When writing a directive, how do I decide if a need no new scope, a new child scope, or a new isolate scope?

I'm looking for some guidelines that one can use to help determine which type of scope to use when writing a new directive. Ideally, I'd like something similar to a flowchart that walks me though a ...
3
votes
1answer
308 views

AngularJS Outer ng-repeat not to register watches on inner ng-repeat

This is in relation with my question - Angular JS consumes more browser memory My problem here is I need nested ng-repeats and the nested ng-repeats consumes more memory because of more watches being ...
0
votes
1answer
519 views

AngularJS - Image “onload” event

I have searched for an answer to simple but not trivial question: What is a right way to catch image' onload event in Angular only with jqLite? I found this question , but i want some solution with ...
0
votes
1answer
661 views

Angular.js filters and functions on scope that is changing every second

The problem. I have a table of entries($scope.entries), each row(ng-repeat) with 5 columns, 2 of those columns have custom made filter for various transformations. Now in the same scope I have ...
12
votes
2answers
5k views

Directive isolate scope with ng-repeat scope

I have a directive with an isolate-scope (so that I can reuse the directive in other places), and when I use this directive with an ng-repeat, it fails to work. I have read all the documentation and ...
6
votes
2answers
2k views

Isolated scope with simple angularjs nested directive

Please check this plnkr I have read everyhting can find about directives, scope and isolated scopes. But I still cannot understand the way to make this work. The directive I created works perfectly ...
3
votes
1answer
2k views

AngularJS directive controllers requiring parent directive controllers?

I might be thinking about this completely backwards, but I'm trying to make three nested directives, lets call them: screen, component and widget. I want widget to be able to trigger some behavior in ...
4
votes
1answer
2k views

AngularJS: Access formController of a form placed inside transcluded directive from parent controller

I've created a simple "modal dialog" directive, which uses transclude. I would like to place a form () inside the "modal dialog" directive. I would expect that formController of a form placed inside ...
4
votes
5answers
358 views

AngularJS: how to bind a constant object to a directive

I've created a directive with a binding using "scope". In some cases, I want to bind a constant object. For instance, with HTML: <div ng-controller="Ctrl"> <greeting person="{firstName: ...
3
votes
2answers
2k views

Access Parent Scope in Transcluded Directive

I would like to access a parent directive's scope, but I can't seem to get the right combination of settings. Is this possible and is it the right approach? I really want to avoid putting something ...
1
vote
3answers
296 views

How to dynamically disable ui-sortable directive in angular-ui

I am using angular-ui for sortable using ui-sortable directive. Is it possible to dynamically enable/disable sortable functionality based on the scope state? So I need to have a button which changes ...
1
vote
1answer
890 views

AngularJS - directive scope not setting ng-class on element

Plunker I have a table of data: <table class="table table-hover" ng-class="dndElemClass" drag-and-drop> ... </table> My goal is to give the table a drop shadow by assigning ...
0
votes
2answers
5k views

ng-repeat list in Angular is not updated when a model element is spliced from the model array

Hi everybody, I have two controllers and share data between them with an app.factory function. The first controller adds a widget in the model array (pluginsDisplayed) when a link is clicked. The ...
0
votes
2answers
575 views

angular.js - evalAsync not called

on the following jsFiddle i demonstrate a problem that makes me ponder. It stems from the need to send a system wide event to all scopes, telling them that the system has finished bootstrapping. In ...
2
votes
1answer
143 views

AngularJS binding jQuery qTip2 plugin

I am trying to figure out how to bind the content of a tooltip with angular. I have a directive that looks like this: script.js var myApp = angular.module('myApp', []); ...

15 30 50 per page