0
votes
1answer
12 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 ...
0
votes
0answers
23 views

AngularJS Directive scope inheritance

I am trying to create a angular tree directive, here is the codes : //** Tree constructor var Tree = function() { return { restrict: 'EA', replace: true, template: "<ul>" + ...
1
vote
0answers
18 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)). ...
0
votes
2answers
38 views

Why variable in $scope does not update?

Code in plunker. I have two controllers. In first controller i have handler for button in my view $scope.click = function () { $location.url("/some"); console.log("clicked"); } In handler i ...
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
16 views

Using scope variables with non-form elements

If I have 2 divs (removed ng-click function for simplicity) <div ng-class="{selected: header.type == 'percent'}" data-type="percent"></div> <div ng-class="{selected: header.type == ...
1
vote
0answers
17 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 ...
0
votes
2answers
23 views

$scope array and $scope.$apply in angularjs

I'm learning AngularJs and I'm facing a problem. I want to show an array of items in a view. First in the controller I define the array using $scope.arrName = [], then I receive data from a third ...
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 ...
0
votes
1answer
30 views

$scope variable has no content

I had controller and function getData as shown. The problem is that the $scope.results outside the for loop has no content. While inside the second http.get request, It has content. ...
1
vote
1answer
33 views

checking function when model changes in other instance of the directive?

In angularjs I have made this simple example with two inputs. I want to change the background color of a input to green if its value its equal to 'green'. This example works, (it changes the ...
1
vote
0answers
18 views

Angular: Order of custom event handlers & default handler

In my application, I am defining a custom event for which I wish to have default handler in place. If any controller/service wants to override default handling, they can do so by adding their own ...
0
votes
1answer
12 views

Pass Data Between Angular UI Modals

I am looking to pass data between modals using Angular UI. Here is the modalController that defines the controller and view partial for each modal. app.controller("modalController", function($scope, ...
0
votes
1answer
36 views

$rootScope and factory methods

I am trying to extend the $log provided by AngularJS through .config() and $delegate, so that I can catch all the calls to $log and $broadcast them. This way, other controllers can catch the $log ...
1
vote
2answers
26 views

Angularjs databinding between factory and view

I'm having some trouble with databinding in AngularJS. In short I'm trying to link a variable from my factory to my view (the $scope). The factory (in my full implementation) listens to specific ...
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
37 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
3answers
26 views

Angular module dependencies

I want to create seperate module for pagination, because I will need it to reuse in different modules, but I don't know how to call a function from module dependency (another module) Here is my main ...
1
vote
2answers
34 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', ...
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
25 views

Inject one service (factory) into another, both of which are async

I should do the following: query an API for a large dataset of names, probably via a service/factory, using $q (async) have another service (also async) which should only return elements of the ...
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
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
17 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 ...
0
votes
1answer
17 views

Watching and limiting size of array in angularjs scope

The premise of what I am trying to do is to have a simple Q&A system that shows only one question at a time. After each answer is given another question is presented until $scope.quiz is ...
0
votes
3answers
34 views

AngularJS automatically updating controller data by service

I'm having some basic problems with angular at the moment. I just wrote a service that reads the temperature of an external device in an interval of five seconds. The service saves the new temperature ...
0
votes
0answers
25 views

cannot use $scope inside window.fnName in angularjs

I wonder why I can't use $scope inside window.fnName = function(e){ }; I tried to inject the $scope like this window.fnName = function(e,$scope) but still fail. here the full controller code of ...
0
votes
1answer
22 views

Submit and disable all buttons in an ng-repeat without adding a new property on the scope

I have a list of items where each item is clickable and should trigger the submit(id) function. I would like to disable all items (buttons) when one of them is clicked. <ul> <li ...
0
votes
1answer
21 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
1answer
27 views

How to dynamically bind function to ng-click using the function expression from model

I have the following element in my Angular template to generate a button bar with Font Awesome icons: <li data-ng-repeat="btn in navigation.buttonBar" data-ng-click="{{ btn[1] }}" ...
0
votes
1answer
20 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" ...
0
votes
1answer
18 views

Angular JS scope not updating from included template

So I have below index.html: <div ng-controller="UsersController"> <div ng-include='"assets/users/partials/template.html"'></div> <a ng-click="get_data()">Get</a> ...
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
1answer
34 views

How to reload angularjs scope data without rerendering bound view

I've got a small problem. I have a bootstrap tabset within an angularjs app. The tabs are partially generated from ng-repeat and contain data, that is bound to the scope. Basically, within the ...
0
votes
1answer
20 views

Inject object reference in angular controller on instantiation

I have the following problem: I'm building a self-declaring app and it needs to register a ButtonCtrl but the instantiated object needs to have a reference to an external object outside Angular. I ...
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 ...
0
votes
2answers
31 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
2answers
45 views

Can't update variable in angular.js

I'm building a Ionic application with angular.js, I'm almost done, but now I have a minor trouble. In my templates/menu.html I have: <ion-item nav-clear menu-close ...
1
vote
0answers
12 views

Angular ui-sortable + angular-gridster

I'm trying to combine the functionality of ui-sortable and angular-gridster so that I can pull an item from a list and drop it into a rearrangeable grid. ui-sortable and angular-gridster have the same ...
0
votes
0answers
18 views

Trying to read all response headers through angular interceptor

I'm trying to read response header through an $httpProvider interceptor to read all headers of all ajax request. $httpProvider.interceptors.push(['$q',function($q) { 'response': ...
2
votes
1answer
40 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 ...
1
vote
0answers
31 views

Push non-angular object to AngularJs controller scope

I have a Angular controller that have a FormData scope, e.g: $scope.FormData. Data is collected via model connected to a simple form. Also, I have an external non-angular js code on the page. I need ...
0
votes
3answers
22 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
29 views

Auto Set fields with $scope variables - AngularJS

aving trouble filling text field and pre select a dropdown. This is my angular code. angular.module('MyCtrl', []) .controller('myController', ['$scope','$http', function($scope,$http) { ...
0
votes
2answers
33 views

AngularJS: ng-click listen on a different / specific controller

I have a login form directive with its own controller. The controller basically does the user login when the form is submittted fine. This works absolutely fine. I am trying to contain my user login ...
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 ...
0
votes
1answer
95 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 ...
1
vote
0answers
34 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 ...
0
votes
0answers
14 views

Keep getting undefined when calling $resource.query from function declaration

I am able to retrieve sample data through a web service using the codes below: // data.service.js angular .module('app.core') .constant("productUrl", "http://localhost:61938/api/products") ...