Questions tagged [isolate-scope]

AngularJS questions involving isolate scope directives

Resources

87 questions
21
votes
5 answers

Access controller scope from directive

I've created a simple directive that displays sort column headers for a I'm creating. ngGrid.directive("sortColumn", function() { return { restrict: "E", replace: true, transclude: true, scope: { …
Matt Roberts
  • 26,371
  • 31
  • 103
  • 180
15
votes
1 answer

Using expression `("&")` binding to pass data from AngularJS component to parent scope

Can't access controller scope from angular component output binding function I'm trying to access my home controller scope from dashboard component but it's undefined. I also tried a second approach but then my function variable is undefined. I'm…
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
15
votes
3 answers

Angular ng-animate 1.3.* Causes to unexpected behavior to ng-class inside directive

I'm in the middle of the transition from version 1.2.* to 1.3.* , and I came across a very strange and critical bug. In my application I have a very simple directive contain a template with ng-class (with condition to scope property) for some…
8
votes
2 answers

ngChange fires before value makes it out of isolate scope

//main controller angular.module('myApp') .controller('mainCtrl', function ($scope){ $scope.loadResults = function (){ console.log($scope.searchFilter); }; }); // directive angular.module('myApp') .directive('customSearch', function…
Rob Allsopp
  • 3,309
  • 5
  • 34
  • 53
4
votes
1 answer

Passing data from ng-click within directive into a function in the controller

I found this question which gets me almost to where I need to be. Why doesn't ng-click work in my directive and how do I add a toggle class? Which makes it so my ng-click within my directive template triggers a function in my…
3
votes
3 answers

Isolated scope binding types

According to AngularJS Developer Guide - Directives "Isolating the Scope of a Directive", scope binding can be done in 3 types =, @ and & and according to "Directive Definition Object" section in this Page, scope binding can be done in 4 types =,…
3
votes
2 answers

Why should I use Isolated scope?

I'm creating a directive which needs some data from the parent controller. Putting the data in the controller in scope like $scope.data = myData; makes the data accessible in the directive. I saw that the for passing data from controller to…
I'm nidhin
  • 2,592
  • 6
  • 36
  • 62
3
votes
1 answer

Isolating scope in AngularJS directive

I'm pretty new with Angular and I'm trying to write my own directive to learn how these objects works. My problems regard on how isolate the scope of my directive so I can use it many times in the same controller. I created a plunker here to better…
pardie
  • 399
  • 2
  • 16
3
votes
1 answer

isolate scope angular binding not updated from geolocation

I'm using isoated scope in a directive. Everything seems to work fine. I set a = scope on two properties and bind to them in my template. Then, in my controller I call my service, get the data and push it onto the bound objects. What is really…
cocogorilla
  • 1,815
  • 14
  • 36
3
votes
2 answers

Proper way to $watch external changes to a ngModel from inside a directive

I'm trying to make a directive that reads from two input sources and do some stuff to turn it into one. So to do that I'm listening to the changes of my two inputs and assigning the new combined value to the ngModel of my directive. The problem is…
3
votes
1 answer

AngularJS event-based communication through isolate scope

In AngularJS, how can one directive use event-based communication ($emit, $broadcast and $on) to communicate with another directive which has an isolate scope? I've created two directives, and when the isolate scope is removed from the second…
Aristarkh Artemiy
  • 347
  • 1
  • 4
  • 10
2
votes
0 answers

Running parallel tests in separate AppDomains/Processes with MbUint

Is it possible to run tests in parallel with mbunit and AppDomain/Process level isolation?
Pawel Pabich
  • 2,404
  • 4
  • 22
  • 33
2
votes
1 answer

How to Pass parameter from AngularJS Directive to AngularJS controller function

Thanks in advance,Actually I want to call a function in controller from app.Directive, Please anyone let me know How I can call?Also I passing parameter to that function?I'm new in angular and here is all code. var app = angular.module('quizApp',…
Frank
  • 41
  • 5
2
votes
1 answer

angularjs directive unit test fail with controllerAs, bindToController & isolateScope()

I am trying to unit test a directive with a two-way bound property (=). The directive works in my app, but I can't get a unit test working that tests the two-way binding. I have been trying to get this working for days. I've read MANY examples that…
2
votes
2 answers

Angularjs directive within ng-repeat not updating outside controller data

I have a isolate scope directive that I am using inside ng-repeat, which is iterating over an array from the controller of that template. The template is as follows:
1
2 3 4 5 6