0
votes
2answers
15 views

How to access AngularJS Directive attributes when inside & outside an ng-repeat?

Have the following attribute directive. angular.module('app.directives.auctionItemCard', []) .directive('auctionItemCard', function() { return { restict: 'A', ...
0
votes
2answers
35 views

Angular model not updating when being replaced

This Plunkr demonstrates what I'm having an issue with. I have an array that's presented both in a dialog and in it's parent page. Modifying that array within the scope of the dialog works just ...
0
votes
2answers
22 views

Notifying angular of change

I'm trying to make angular refresh itself as soon as the data model has changed. I have data store object is a rather complex model but in the end should provide angular with the data it has to render ...
2
votes
1answer
36 views

Best practice in keeping `$watch` functions away from your controllers

I tried to find some good examples on best practice in moving $watch functions from a controller to a factory, for example. What I have found is that actually there isn't a unanimous opinion on ...
1
vote
1answer
23 views

Cannot read property push of null

while pushing an element for the first time to a child array which is null,I'm getting this error "Cannot read property push of null" But the element gets pushed,and the second time I do everything ...
0
votes
2answers
25 views

Recursive call of directive crashing the browser tab

I have an observation directive which render observation.html observation.js angular.module('bahmni.clinical') .directive('observation', function () { var controller = function ($scope) { ...
-2
votes
2answers
29 views

“Object doesn't support property or method 'push'” [duplicate]

I'm trying to add new value into existing JSON object in AngularJS but I'm getting this error message: "Object doesn't support property or method 'push'" Here is my code: $scope.addStatus = ...
0
votes
0answers
10 views

Angular computed observable on child object

Im trying to make a small test with angular but got some problems I cant get it to work How do I make an observable in a child object in angular? The problem with this code is that when I load a saved ...
0
votes
2answers
35 views

ng-show and $scope.$apply issue

On the HTML I have an overlay div to show a loading progress which uses the directive ng-show="showLoading". On the template ng-click I call the controller searchRequest method. This method updates ...
0
votes
1answer
20 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
2answers
22 views

Angularjs only triggering ng-change on input radio the first time its selected

I have made a simple example using angularjs. This example contains three radio inputs, each of which have to call a function on change (ng-change => console.log). Unfortunately, the function its only ...
0
votes
1answer
34 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
25 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 ...
1
vote
1answer
35 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
14 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
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
11 views

Two way databinding in Angular when using method in template

Is there a way to tell angular that a particular function in $scope is dependant on some other fields in $scope? I would like to hide some functionality in data model, for example: $scope.user = { ...
0
votes
0answers
33 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>" + ...
3
votes
2answers
40 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
1answer
40 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 ...
1
vote
1answer
34 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
20 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
14 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
44 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 ...
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
52 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
28 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
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
2answers
28 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
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 ...
0
votes
3answers
38 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
1answer
28 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
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
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
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 ...
0
votes
0answers
20 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
44 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
32 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
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
0answers
17 views

Binding angular with an existing data model

I'm looking at html data binding and templating alternatives to apply to an existing model-driven system. I promise I'll get to the Angular question below, but it will have little meaning without some ...
0
votes
1answer
21 views

AngularJS matching filters exactly and not part

<li class="column__list--item" ng-repeat="skill in skills | filter: { skillset_id: filterbySkillset }"> I've noticed that when I try filter using the above, it filters anything it ...
4
votes
1answer
71 views

AngularJS - handle routes before app startup

Is it ok to use a Service within $stateProvider, for this purpose? I have been through a lot of posts on stack regarding routing but most are confusing for beginners as everyone uses a different ...
1
vote
0answers
17 views

How to share data in between two controllers using angular JS?

I am new to angular JS and Javascript. I am working on a angularJS project and In project i am using several modules like Secreport -> secreportpage -> secchart. I passed data from mainCtrl to ...
0
votes
0answers
29 views

AngularJS: Change directive attribute on event

I have another question on angularjs. Everything works fine here, except one thing. I have a array where every dir is stored and in the view the are rendered as my custom directive via ng-repeat. The ...
0
votes
4answers
58 views

passing $scope to the services in Angularjs

I want to pass the $scope to services and store it in the services so other controllers can use it. For my application user input the UserName and through ng-model i am passing it back to ...
0
votes
1answer
22 views

Routing and Multiple view dones not show in angular js?

HI i m try to show routing and multiple view in my anguar js code but there is not show can u please help me what is the problum and how to solve it. Please Help me . My Code it this HTML File ...
-1
votes
2answers
26 views

Angular: update scope var within child function

In app.js: .controller('MainCtrl', function($scope) { $scope.history = { drive: "Jim" }; $scope.getNote = function () { $scope.history.drive ="Eric"; } }; In HTML ...
0
votes
2answers
26 views

Watcher on a element attribute to change the elements inner html

The div's content is being filled up with the content of the attribute sk-placeholder. I have an if statement which will fill up the content of the div with a certain text or an empty string depending ...
0
votes
2answers
76 views

Cannot get data from firebase in directive angularjs

I'm doing a slider following the steps from this tutorial using Angular.js and Firebase API. I have created a directive 'slider' in my directive file, here is the code: .directive('slider', ...