0
votes
1answer
17 views

How to check if expression will have a value after evaluating

Let's say I have a following template: "foo['x'] = '{{ myVar }}';" Is there an angular way of checking if evaluating this against my current scope will give myVar some value ? I've got an array of ...
1
vote
3answers
37 views

AngularJS directives data binding doesn't work

DEMO Here is a simplified version of the two directives I have, my-input and another-directive: HTML: <body ng-controller="AppCtrl"> <another-directive> <my-input ...
0
votes
1answer
17 views

angular directive scope: setting a default value

I'm creating a datepicker directive, part of its markup is: <select class="form-control" ng-model="day" ng-options="day.nr for day in allDays"> I'm trying to define allDays in the scope ...
0
votes
1answer
31 views

Load directives based on value

my issue is that I have a directive as follow: app.directive('bottomNavBar', [function () { return { templateUrl: 'views/bottomNavBar.html', restrict: 'A', replace: true, transclude: true }; ...
0
votes
1answer
13 views

AngularJS: How to inherit the scope the directive locates in, and get attributes value same time

Could anybody help with this? Is there a way to access the scope the directive located in (e.g. a controller's scope) while I still can access the attributes' value. here is my directive code ...
0
votes
1answer
23 views

Multiple directives need to share same private scope

I have two directives, one is restricted to the element and the other to an attribute <bar-foo special></bar-foo> Now the issue is that the special directive need to define something on ...
3
votes
2answers
34 views

Isolate scope - access scope attributes on element

When creating a directive with isolate scope, I can't access scope properties on the directive element (it's was not the case in angular 1.0.7, but in later versions (e.g. 1.2.17)). ...
2
votes
0answers
31 views

AngularJS: Directive Scope is not getting $destroy called

Been searching for awhile in the archives and on the 'net for an answer, but not really finding one, just bits and pieces. Seems there's a lot of suggested posts, but none of those have the answer. I ...
1
vote
1answer
34 views

How to get field that made form dirty in angular?

Is there any way to know what field made the form dirty in Angular? I have an "auto save" directive that checks if there was any change inside the form, and saves it accordingly (trough server ...
0
votes
0answers
13 views

Nested tree view menu with directives

I have to create a sidebar menu that has two or three levels and that the developer can enable or disable some features, such as icons, labels and animation. I have created four directives, one for ...
0
votes
1answer
7 views

Append directive to body

I have a popup directive, and I would like to compile and append it to body. Is there a simpler way then recompiling and appending directive to body. link: function (scope, element) { ...
0
votes
1answer
51 views

Angular - Directive attributes vs scope variables

I have some difficulties understanding the directive attributes vs scope variables passed in a directive. I am working on a directive that dynamically loads the correct template depending on the ...
0
votes
0answers
32 views

Using scope in Angular directive templates

I have a problem in that I need to toggle some classes based on a value that can only be determined once the template has been compiled. That's probably not a very helpful description but I'm not ...
0
votes
1answer
25 views

angularjs directive's '$element' is a comment because of ng-if

I'm trying to build a popup (dialog) directive for my angularjs application. (still lots todo...) However I made a template file which builds the popup element, with insertion of values from the ...
5
votes
4answers
11k views

Getting select rows from ng-grid?

How do I create (or access) an array of selected rows in my ng-grid? Documentation (scroll to "Grid options") id | default value | definition ...
0
votes
1answer
21 views

Call a function on Valid Blur

PLUNKER How can i trigger function call on blur only if element is valid has no other error? HtML <input type="text" id="order" ng-model="order" name="order" class="form-control" ...
1
vote
1answer
25 views

Is there a way to pass multiple functions to an AngularJS directive?

I am building a dropdown menu directive which allows you to optionally attach a function to each item in the list. I know how to pass one function per attribute into the directive, but I'm hoping that ...
0
votes
1answer
37 views

Clean destroy of elements and scopes

The question is how do I clean destroy elements and scopes in AngularJS. I've got a binary tree structure, which is implemented by recursively using the same directive. I would like to change the ...
0
votes
0answers
18 views

Get the data on foundation reveal modal

i am trying to search the records with some parameters and get the search result on the reveal modal,i am happily doing with posting the search parameters and getting the data on scope,But not getting ...
1
vote
2answers
35 views

In my service-factory I lookup up a large dataset - I want to persist it and check for its existence to avoid calling it again

My service (factory) makes an API call and assigns response data to a variable: .factory('MedicationMatchingNamesFactory', ['$http', '$q', 'MedicationDisplayNamesFactory', ...
0
votes
1answer
62 views

How do I $watch the Angular-ui's new ui-select (former ui-select2) search string changes?

I noticed that the Angular-UI have discontinued their UI-Select2 directive in favor of the new UI-Select (with multiple themes - select2, bootstrap, selectize). It looks like this: <ui-select ...
0
votes
1answer
26 views

Angular dialog directive with compile function and ng-show does not work

Inspired from this article I created a dialog directive. But I want to be a bit more flexible (e.g. not creating new variables/functions in the controller by hand for each dialog. I also want to have ...
0
votes
1answer
124 views

Multiple Image Upload in Angular JS

My form will have two file input fields and other fields.The user will be sleecting two different types of files and putting in some data. On submit button I want to send both the files along with the ...
1
vote
1answer
20 views

Do I have to use $watch to dynamically pass isolate scope attributes to my custom controller?

I have a controller that stores super heroes. I would like to use a custom directive to display a certain super hero based on the value entered in an input field. I do not wish to achieve this with a ...
0
votes
1answer
17 views

Angular directive coming in JSON

I have a directive: Here I am passing a data object: <a-link options = "data"></a-link> And here is my directive: .directive('aLink', function() { return { restrict: 'AE', ...
0
votes
0answers
15 views

JQuery file not loading on page with ng-repeat

I am building a real estate listings page for a client of mine with ng-repeat from a json data file that holds all his listings data. On each listing I created a 3 field form so I can tap into a ...
0
votes
0answers
18 views

AngularJs directive - how to save '&' scope property in the link function

I'm trying to implement a simple button directive with this properties: scope: { text: '@', enable: '@', click: '&' }, The click function will ...
4
votes
6answers
4k 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: ...
0
votes
2answers
32 views

How does scope() method work in Angular JS?

I have created a directive, which has an isolated scope. Somehow, when I try to get scope from the directive's element, it gives me controller's scope, instead of the isolated scope. What's wrong ...
0
votes
0answers
6 views

How to refresh page without calling $scope.$apply?

I have a small input form on my blog for inputting comments. This form is implemented as an Angular directive. After the user inputs a comment I put up a thank you dialog box. When the user clicks ...
0
votes
1answer
22 views

angular getting attribute value and cannot find a proper way

I have this in my dom <div id=“my-lightbox-container" style="height: 0px;”> <div id=“my-lightbox" role="dialog" style="width: 660px; height: 342px;”> <button id=“my-close" ...
0
votes
2answers
27 views

Angular hide/show based on radio button

Plunker How can i make yes radio button to be checked on page load and show/hide the field-set accordingly. Currently on load radio button is checked but its not showing the fieldset. Html ...
0
votes
1answer
22 views

Two-way binding in an angular directive leads to loop

I have a directive with a select in it. Here is a cut-down example. Note the real code has more moving parts and some logic. app.directive('numberPicker', function() { return { restrict: ...
0
votes
0answers
17 views

Dynamic TemplateUrl

I have screenControl and screen directive. I want to dynamic screen templateUrl from screenControl directive. Can i send dynamic templateUrl with attr from screenControl to screen. index.html ...
2
votes
1answer
42 views

directive doesn't load correct after ngroute

I've got a Problem with an isolated scope in my custom directive. I've built a custom directive. It worked when I didn't set the scope-attribute in the directive by using the parent scope. What did ...
21
votes
7answers
19k views

Confirmation dialog on ng-click - AngularJS

I am trying to setup a confirmation dialog on an ng-click using a custom angular js directive: app.directive('ngConfirmClick', [ function(){ return { priority: 1, ...
1
vote
3answers
2k views

Angular directive: bind to variable in parent scope

Angular directive demo: jsfiddle <div ng-app="myApp"> <script> function Contrl($scope){ $scope.parval = 0; $scope.items = [ {id: 1, text: '1'}, ...
0
votes
3answers
23 views

How to access an object attribute inside a service in AngularJS?

I have a service with a local variable object with events names: myApp.service('appService', ['$rootScope', function ($rootScope) { var events = { firstEvent: "MyFirstEvent", ...
0
votes
1answer
96 views

Angularjs Directive scope

I'm trying to create a directive and am running into some problems with the scope object. In creating a plunkr to display what is happening I noticed that I'm close, but not quite sure what I'm ...
0
votes
0answers
14 views

Linking to a specific position on one page from a different page based on a json array variable

I am re-developing a clients site using AngularJs and since they list businesses for sale, I've placed all their data in a json file, then populated a page with ng-repeat. Everything works great, but ...
1
vote
0answers
35 views

AngularJs TemplateUrl

I have two directive and I want to dynamic templateurl with attr. For example; I want to send attr with deviceEmpty tag. If this tag not null, use this tag. If this tag use static url. AngularJs ...
1
vote
2answers
1k views

Controller Required By Directive Can't Be Found

I have a directive that I'd like another directive to be able to call in to. I have been trying to use directive controllers to try to achieve this. Directive one would be sitting on the same page ...
2
votes
2answers
30 views

Why in the same value in directive is defined and undefined at the same time?

Why I have value in scope as undefined but it is defined. HTML <body ng-app="plunker"> <test-dir></test-dir> </body> And JS var app = angular.module('plunker', ...
1
vote
0answers
16 views

angularjs: requireing and using tabsetCtrl.select

I am trying to create a directive that will automatically activate angular-ui tabs based on routes. my directive is intended to be added to every tab element within the tabset. I am requiring ...
2
votes
1answer
27 views

How can i count the number of errors on Form?

FIDDLE How can i count the number of errors made on form ? HTML <div ng-show="form.$submitted && form.$invalid"> Sorry but 3 errors have been made. </div>
1
vote
1answer
40 views

Form Validation angular/bootstrap

Here's FIDDLE Not able to understand that why the required validation is not working ?? HTML <div ng-app="app"> <div ng-controller="myctrl"> <form name="myform" ...
1
vote
1answer
33 views

Form Validation and disabled button

PLUNKER LINK In above problem i have three radio buttons which let the user pay balance,minimum amount and other amount.When user clicks on third radio button it opens up a div with input where user ...
1
vote
1answer
39 views

Why can't I modify the isolated scope value in my directive controller?

Given the following Plunker: http://plnkr.co/edit/YicBDARAf5umI0PdCL8L?p=preview Why isn't $scope.someVal being set in the directive controller? I would expect the output of the template to show ...
1
vote
1answer
23 views

Move an entire child directive to a new location

I'm creating two Angular directives that serve as a special kind of list. One is the parent, and the others are items in the list. The problem I'm running into is that one of the child items has to be ...
2
votes
2answers
25 views

$compile'ing already compiled elements is not supported, what to do then?

According to lgalfaso on Angular.js repo: lgalfaso commented 8 hours ago Recompiling an already compiled element is an abuse and not something supported. I do not know what you are trying ...