0
votes
1answer
9 views

Why can't I use Angular an angular directive's $set function to set ngPattern, ngMinlength and ngMaxlength?

This is going to sound weird, but, even if it is bad practice or something, how would I get this: html: <div ng-controller='CtrlCtrl as ctrlr'> <input account /> <button ...
0
votes
2answers
28 views

AngularJS - ng-click in shell page

I have an Angular JS app in which the header and footer are part of index.html, and the views are loaded dynamically between. I have a signOut() function on the scope in my controllers that makes the ...
0
votes
1answer
36 views

Call controller method from directive

I have a button which change the "active" state. First, it loads the status from the server <button active="data.active" ng-click="changeStatus()"></button> directive code: ...
1
vote
0answers
428 views

AngularJS - Share ngModel with nested directives and transcluded directives

I am trying to create 3 directives: .directive('dirOne', function () { return { restrict: 'E', transclude: true, replace: true, controller: function ($scope, ...
0
votes
0answers
24 views

Binding a resource and a js object angularjs

I have a navigation menu that I am building based off of a json object coming from an $resource. Sometimes I need to append to this list with new menu items from another $resource. I want to bind the ...
-1
votes
0answers
34 views

Angular custom element renders incorrect attribute value

This is my first Angular project. I am trying to create a custom element using "Angular JS". I create a <div> using a template and assign attributes for <div> using scope. The problem: I ...
1
vote
0answers
27 views

AngularJS - JSON and return all results

I'm trying to write a basic search function using AngularJS. I have written a service that finds my JSON file and binds it to a $scope object $scope.SearchResult What i am trying to do it perform a ...
0
votes
0answers
30 views

Custom directive using ng-model inside ng-repeat

I'm trying to create a list component that is bound to a list defining column metadata and row values. For example: var list = { cols: [ { name: "date", display: "Date", type: "date" }, { ...
3
votes
3answers
5k views

Angular JS: Load CSS and JS files dynamically

I am in the middle of developing an web app. I am using AngularJS for loading all the files dynamically into the UI. 1. i have and index.html onto which all the files will be loaded dynamically on ...
0
votes
2answers
16 views

AngujarJS template not rendering correct

I have a problem with getting a template populated with data, from a directive. This is what I have: app.directive('mypopover', function ($compile,$templateCache) { return { ...
0
votes
2answers
45 views

angularjs-nvd3-directives value outside function

I can't find a way to retrieve a value from a function of angular-nvd3-directives, I tried everything, using $emit, $broadcast, $scope.varName. I have the correct value printend in console, but I ...
0
votes
0answers
13 views

Ng Table Pager template is not allowing any custom data binding like ng-click=“Custom Function”

first I have used a ng table pager template I am not able to use my custom function like ng-click='first()' instead of ng-click="params.page(page.number)" and then call the parameter inside it's ...
0
votes
1answer
42 views

Update ngModel on a directive, from a directive

I'm having trouble understanding why changes to an ngModel doesn't propagate from one directive to another. Here's a plunker that shows a simplified version of what we're trying to do. Basically, ...
0
votes
0answers
19 views

Click event gets executed even after window.confirm returns false in angular confirmation dialog

Based on the example given here I have written a directive to display a confirmation dialog in Angular when a button is clicked. The problem is even after the user clicks on the cancel button on the ...
0
votes
1answer
11 views

How to listen for a site-wide event in a directive with isolate scope

I am creating a custom chart widget in angularjs using a directive with isolated scope. The idea being that each widget should be able to exist in isolation after receive basic config information on ...
3
votes
3answers
2k views

How to detect browser using angular?

I am new to angular. How can I detect userAgent in angular. Is it possible to use that in controller? Tried something like below but no luck! var browserVersion = int((/msie ...
0
votes
1answer
20 views

Copy value from scope object in directive

I have a directive where I am reading in values as attributes and storing them in scope. My markup is as follows: <my-directive ng-model="myCtrl.widgets" ...
1
vote
1answer
15 views

How to use $scope.watch for a scope inside a directive?

I would like to watch the model search.value inside my custom directive. How do to this ? HTML : <div search></div> DIRECTIVE : app.directive('search', function($rootScope) { ...
1
vote
2answers
22 views

Select does not auto update on ng-model change rendered using ng-repeat

I am creating dropdown in a directive as follows: <select ng-model="selectedSite"> <option value="new">Add New Site</option> <option value="line" ...
0
votes
0answers
17 views

Updating “treedata” model array in angular-tree-control will not update the UI. Why?

I am using angular-tree-control of wix: http://wix.github.io/angular-tree-control/ The main problem is to understand how to update the UI tree with new children nodes, not by clicking on the folder ...
1
vote
1answer
38 views

Angular.js return value from directive to controller

I have a problem with directive. I found this plugin: http://allensarkisyan.github.io/VideoFrame/, now I have this plugin implementation in my controller: HTML <div class="row" ...
1
vote
1answer
25 views

AngularJS ng-model not two-way binding properly as part of directive

I'm trying to make a simple Angular directive for a currency input. It should behave as a float in the model but it needs to display a to the user. It also needs to force the display of 2 decimal ...
0
votes
1answer
33 views

AngularJS isolate scope how to add to correct parent scope?

I have a directive 'outerDirective', it has children that are directives, and they have children that are directives. How do I add the grandchildren directives scopes to the correct child directive ...
0
votes
0answers
40 views

Angularjs Directives Scope Issue

I am having trouble with a directive. My model updates with data that is being loaded by a http call. Without the call the service the directive works correctly. I have a directive called ...
0
votes
0answers
28 views

ngClass is not updated successfully in a directive

I have created a directive, that creates a popup with a ul element, but ng-class = isVisible is not returning the correct value. It works, if I only have one use of the directive at my page, but when ...
0
votes
2answers
40 views

AngularJS: $watch not firing when value changed in directive

I've got custom directive that add's a property to the scope in side the link function, then it add's a watch to it. If i changed the value of the scope property from the controller the watch gets ...
0
votes
1answer
20 views

Angular how to get route id at resolve block?

How can i get "pageid" inside resolve block? For every url change i had to request the server, along with the "pageid"? My code: app.config(function($routeProvider){ $routeProvider ...
0
votes
1answer
28 views

Getting the Angular Typeahead to work with JSONP and JSON with properties

I've been pulling my hair out trying to get the $http.json() to properly return a result set of objects. I have locally stored examples of the same response and they work fine. Can anyone look at ...
0
votes
1answer
15 views

Force disable directive cache or reload angularjs directive

How do I force re-render my directive Template <div ng-if="showDirective"> <my-directive attr="value"></my-directive> </div> <button ...
1
vote
2answers
43 views

AngularJS Accordion Expand All Collapse All

I am trying to get the accordions to toggle correctly through the directive ng-click. If I have Item one open how do I get it to expand all the accordions? Item two and Item three will continue to ...
3
votes
2answers
2k views

AngularJS directive link function not being called

I am trying to use angular-http-auth library with bootstrap modal window. Modals are working fine but I have problems with directives. Here is a jsfiddle link - http://jsfiddle.net/jCUSh/85/ . I am ...
1
vote
1answer
36 views

Angular architecture for a sorting directive

Being quite new to angular, I am searching the best way to achieve a quite simple task. My aim is to update in a database, through angular $resource service, the order (I have a position attribute) ...
0
votes
1answer
29 views

AngularJS directive: Updating the isolated scope

I want to create a directive which displays changing data. For simplicity let's say I want to display the current time. This means that once a second the directive needs to refresh itself. In the ...
0
votes
0answers
24 views

Directive template unable to reference a scope object's properties (even though link() can)

In my application I've got a directive, table-panel which sets up another sortable-table directive. The HTML looks like this: <table-panel data="table.data" search="search.s" ...
0
votes
1answer
34 views

How to access the “right” scope from inside a directive?

I need to order the table rows in several places. As there's just one "main" table shown, I've decided to use a rather global variable $scope.n.order (where n is my collection of non-important ...
0
votes
0answers
21 views

Angularjs: how to Call method in Controller while submitting the Form

Actually In my form page of Angularjs, have two submit buttons i.e In one field set i have one button for update and another button at the outside of all field sets for submission of whole page. Code ...
0
votes
1answer
27 views

angular - ng-if - how to callback after ng-if template has been rendered

in Angular, I need to call a function after an element with certain class has been loaded. Display of the element is controlled via ng-if='expr'. Value of $scope.expr is set after some ajax call has ...
1
vote
1answer
21 views

AngularJS getting data from item where

When an item in the list is clicked, an ng-click fires with the id of the item sent, the idea was to get the description of the item to match the id but it seems to only be picking up the index of the ...
0
votes
0answers
19 views

Data assign through service not updating in Angular JS

I wrote a service to share and update Datas between controller myApp.service('Physician',function($http){ var physicians = []; var refresh = function(fetch) { physicians = [] $http({ url: ...
0
votes
1answer
121 views

AngularJS - scope differences

I created a simple fiddle, to illustrate the differences between scopes (true, false, {}). But I can't understand, why it's not working as I expect... 1) Why changing the "val" on controller, ...
1
vote
1answer
38 views

Difference between ways to declare a scope in a directive (ways shown inside)

I'm new to AngularJS, JavaScript and HTML. My question is: ¿What is the difference between the four ways to declare the scope in a directive? I'm going to show the way and then write what I think ...
1
vote
1answer
38 views

AngularJS Directive to directive communication

I've a directive nested within another directive as in the below fiddle. http://jsfiddle.net/sriramr/T7W6T/3/ My question is: if a variable in the parent directive changes value, how to ...
3
votes
3answers
3k views

How to bind boolean values in angular directives?

I'd like to bind/set some boolean attributes to a directive. But I really don't know how to do this and to achieve the following behaviour. Imagine that I want to set a flag to a structure, let's say ...
0
votes
1answer
50 views

What is happening when I use .scope() in angularjs?

Could someone please explain what is happening when I use .scope() inside of a directive? I have a directive that is assigned to create a grid of squares. On load, I would like those squares to be ...
0
votes
2answers
38 views

How to create a new isolated scope with an existing object?

I want to create a new scope with this object: $scope.model = { itemA: "First item", itemB: "Second item" }; // I know, this is wrong, but I want to show you, what I would like to do. var ...
0
votes
1answer
32 views

How do I get a watch function in a directive to fire when elements are shown or hidden in angularjs

I'm trying to write an angularjs directive that works like foundation-equalize. My problem is that I want it to work with elements that are hidden when the page loads and then appear when a user ...
0
votes
1answer
28 views

Difference between defining isolated scope variable for angular directive in {} and in link

In angular directive, I know I can assign isolated scope, but I need to add '=' or '@' or '&' to define variable in {} while I don't have to do that in link, for example: scope: { foo:'=foo', ...
3
votes
2answers
94 views

AngularJS only shows last Element in ng-repeat

I've got a strange behaviour using flexslider to render a bunch of galleries. As shown below I've got an array of several objects that conclude an array of images. When I "render" the galleries, all ...
-1
votes
1answer
21 views

ng controller having '/' seperator Angular JS

I am new to angularjs Programming. Today I reading interview questions on angiular js and I find that ng-controller having some '/' and some names I am not aware about it . What is it mean. PLease ...
0
votes
0answers
13 views

AngularJS - How do I activate a class animation from index.html?

I'm still fairly new to AngularJS, and can't seem to figure this out. In my index.html, I have this div which is hidden at first. <div class="goom-player" id="goomplayer" ...