Questions tagged [isolated-scope]

AngularJS questions involving isolate scope directives

Resources

16 questions
1090
votes
18 answers

What is the difference between '@' and '=' in directive scope in AngularJS?

I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle. And here are some relevant snippets: From the HTML: {{text}} From the pane…
iwein
  • 24,288
  • 9
  • 67
  • 108
111
votes
2 answers

AngularJS : Differences among = & @ in directive scope?

Creating an isolate scope inside a directive lets us map the outer scope to the inner scope. We have seen six different ways to map to attrbutes: =attr &attr @attr = & @ What do each of these scope mapping options do?
Shaun Luttin
  • 107,550
  • 65
  • 332
  • 414
1
vote
1 answer

how to get ng-model value in directive

I have written a directive in AngularJS, and used the input type number with min-max and ng-model attribute. I have used isolated scope. In the directive, I have written a blur event. I am getting min-max value but not getting ng-model value:…
1
vote
0 answers

AngularJs same directive for multiple Element, how to change a Isolated scope value

Iam using a directive to form a select element, repeating the json and forming select for each element. Now change of first dropdown1 i need to change the allowed_values of dropdown2. My sample Code.
1
vote
1 answer

why $scope.info binding late on ng-change in custom directive

tag: directive app.directive("gridFilter", function () { return { scope: { varible: "=", onChange: "&" }, template: [ '
1
vote
2 answers

In AngularJS, if the child directive cannot access it's immediate parent's scope then would it inherit its nearest, non-isolated ancestor's scope?

I have two examples in favor of the above statement - 1) When using $scope (http://plnkr.co/edit/kFM77mVReS7AUwZsNzCV?p=preview) -
0
votes
0 answers

Making an AngularJS download directive that is reusuable in multiple views

I'm new to AngularJS and this is my first attempt in creating a custom directive. I found that the same piece of code for downloading a file was used in multiple places so I want to create a directive to improve modularity. Here's is my first…
0
votes
1 answer

isolated scope data not displaying in directive template

I am building a custom Angular directive to display pagination across my application. I'm using isolated scope to pass totalNoOfRecords but it's not getting displayed. Any help will be appreciated Here's my code what I tried so far Template where…
Shashank
  • 375
  • 5
  • 17
0
votes
0 answers

Isolated scope built in directives in angularjs

I was reading about the isolated scopes in AngularJs. I was wondering that are there any built-in directives in AngularJs that uses isolated scope. Could you please provide some useful link or mention some names if anyone came across such…
Mohit
  • 507
  • 4
  • 10
0
votes
2 answers

Calling function of controller from directive when using isolated scope?

I want to call a function of Controller from Directive, It is for validation. But i'm a bit confused about how to call it from Directive when i'm using isolated scope. Here is the code of directive:- App.directive('test',function(){ return{ …
0
votes
1 answer

How can we pass variable in isolated scope function

I have a directive like below -
In directive controller, I bind saveMe() function from controller with isolated scope & like below - function MyParamControlDirective($filter, …
s.jain
  • 13
  • 5
0
votes
0 answers

Can the local scope property and the passed in attribute value be used interchangeably in angularjs directives with isolate scope

I'm following Dan Wahlin isolate scope with function parameters. I have a couple of ambiguity in this article. Since there is no response at that site, I opted for stack overflow. I'm new to the javascript/angular world, response in detail is…
Raida Adn
  • 371
  • 1
  • 3
  • 13
0
votes
0 answers

call a directive function from controller without isolated scope

Is there a way of calling a function defined in a directive from the parent controller without using isolated scope or events?
0
votes
2 answers

Is there any way to use controller scope variable in isolated scope without defining in html/jsp

Below is the code illustrating the isolated scope scenario. directivesModule.controller('CustomersController', ['$scope', function ($scope) { var counter = 0; $scope.customer = { name: 'David', street: '1234 Anywhere…
sandiee
  • 153
  • 1
  • 8
0
votes
3 answers

AngularJS - Pass value from isolated scope directive to another element

Is there a way to pass a boolean value (dataLoading) from an isolated scope directive to another element to show a progress bar when data is loading during login operations? index.html
Daniele
  • 69
  • 4
1
2