The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
32 views

AngularJS - Pass variable from a controller & update from directive

I've set one Plnkr. I want to dynamically add input fields in a directive. The input fields are to be built by a collection from a controller. And change the values of the inputs. But the main problem ...
0
votes
1answer
34 views

Can an AngularJS controller inherit from another contoller in the same module?

Within a module, an controller can inherit properties from an outside controller: var app = angular.module('angularjs-starter', []); var ParentCtrl = function ($scope, $location) { }; ...
0
votes
2answers
17 views

How to connect my controller in my directive for inserting data and adding bootstrap select in angular.js?

I'm trying to add data on my select menu using a controller and used ng-options while i have a class defined in my directive to insert the bootstrap-select plugin to the element. The problem is that ...
0
votes
2answers
52 views

AngularJS - Scope is not what expected inside an ng-click event of ng-repeat

I have this code snippet: <ul> <li ng-repeat="message in messages"> <button ng-click="send()">Send</button> </li> </ul> $scope.send = function(){ ...
1
vote
1answer
22 views

what can or cannot be done with a controller created in a module Vs controller created globally?

Have seen various angular JS examples and I get the hint that I should define controllers on a module rather than a global definition. Say I have an app that has <body ng-app='mymodule'> - ...
1
vote
1answer
86 views

AngularJS Binding, multiple controllers through a service, part of page rendered from php

I know this is long, but it appears something specific in what I'm doing in the more complex scenario is causing the issue. All simple examples I attempt work fine. I have an application setup using ...
0
votes
0answers
160 views

AngularJS - refresh view after http request, $rootScope.apply returns $digest already in progress

Hey guys so I am simply trying to load data when my app starts. However, the view loads faster than the http request(of course). I want to refresh my view once my data has been properly loaded because ...
1
vote
1answer
24 views

What are the differences in angular controller notation?

I've have seen a couple of notations to initialize a controller in angular, those are: app.controller('nameCtrl', function($scope, ... ){}) and app.controller('nameCtrl', ...
2
votes
1answer
49 views

Length of Array returning “undefined”

I am building an application using AngularJS. I use Slim for handling web service in my application. I have a service like: angular.module('MyApp'). factory('MainPage', ...
0
votes
1answer
54 views

Search results filter - controller or service or filter?

I have a search results page. The search results page is basically one large controller at the moment. I have code which is for the filters however this isn't an angularjs filter as such because I'm ...
0
votes
1answer
69 views

where should i use the $http in angularjs? -> difference between factory and service

wher should i use the $http in angularjs? in the controller or in the service? i have already implement it in the service, but i want to execute not at the start of the app, i want to execute after ...
0
votes
1answer
38 views

binding a ng-repeat child object to another child object (zipcode +city!)

Mainly psuedo code so please dont mind if there's typos. I'm trying to figure out how to access the value of address.City.ZipCode for my controller method; since this is just a child in the address ...
0
votes
0answers
39 views

How to have page controller execute directive functionality AngularJS

Lets say I have a directive that has an isolate scope and that scope have a method on it. Now is there an Angular way to allow the page controller to be able to call functionality declared in a ...
1
vote
1answer
151 views

Jquery animation in a AngularJS controller or directive?

I have an app in AngularJS and in one of my view I want to implement some JQuery animation..nothing too fancy..just hide/slide of a divs ..those divs are created from ng-reapet loop and I need access ...
0
votes
0answers
170 views

AngularJS - “10 $digest() iterations reached” when ng-view ng-repeat dependant on $routeParams

I am really new to Angular and this is the first time that I am dealing with routing, so please excuse me if my questions are a bit confusing. My actual logic and structure for this app is much more ...
0
votes
1answer
21 views

How to create an AngularJS controller according to the documentation

I'm new to AngularJS and I'm trying to figure out why some of the documentation code isn't working for me. While the global function controller below works for me, the documentation says I should be ...
0
votes
0answers
31 views

How to create nested views and controllers in AngularJS without using ng-controller in the attribute

I have an application wide router, where the routes specify the template and controller to instantiate while navigating: $routeProvider .when('/', { templateUrl: 'views/login.html', controller: ...
0
votes
2answers
31 views

AngularJS - stops working when using controllers

So I'm just now starting to get into angularJS and things were fine with tests until I got into using controllers with ng-repeat. It seems that when I use it it just doesn't connect to the controller. ...
0
votes
0answers
66 views

AngularJS - Create a directive to fire an event (function) when the current element is appended to the DOM

I am trying to find a way to detect when an element is finally appended to DOM? Is there any directive that I can create and attach to that element so it will detect the moment of appending? By ...
0
votes
0answers
22 views

Trouble with editing objects in AngularJs

EDIT: the code on the plunkr works as it should, but not on my local machine, the only difference is that locally edit-website.html template is stored in partials folder, which is refferenced in the ...
0
votes
1answer
144 views

AngularJS - How do I avoid using $timeout to wait for an element to be created?

Here is the idea: So I am trying to use an external library function to create some manipulation in the DOM in one of my controllers that my ng-repeat is connected to. Newest jsFiddle working but ...
1
vote
1answer
168 views

AngularJS and ng-repeat elements do not exist in DOM yet - getting NULL exepction

So I am trying to use an external library function to create some manipulation in the DOM in one of my controllers that my ng-repeat is connected to. The problem is the following: I am calling that ...
1
vote
1answer
106 views

Using AngularJS and jsPlumb (use jsPlumb functions in AngularJS controller)

So I have a project that I am working on and it requires that I use jsPlumb for graphical elements connections and I am building my app entirely using AngularJS. What is the procedure to follow if I ...
1
vote
1answer
39 views

Function not defined error for a function that's defined inside an angularjs controller

I've looked through other "function is not defined" questions, but can't seem to find one that's applicable to my use case. I'm using angular.js. I have an initially empty div, #mylist that I am ...
0
votes
1answer
63 views

Angular using another directive's controller?

If I have two directives, and need to have one of them use the controller of the other one, what is the best way to accomplish something like that in angular? I'm trying to use the require: ...
1
vote
1answer
27 views

AngularJS: How to set controller's property from a directive when using the “Controller As” syntax?

LIVE DEMO Consider the following example that uses the Controller As syntax: <body ng-app="myApp" ng-controller="MyCtrl as my"> <div> {{ my.message }} </div> <button ...
1
vote
1answer
216 views

Angular reload embedded controller

I have a controller embedded using the ng-controller tag and it works fine but i've also got an external controller who needs to call one function of this controller: <div ...
0
votes
0answers
127 views

angular ui-select2: fire highlight events programmatically (without using JQuery)

is there a way to call highlight events of select2 in a programmatic way? something like "ng-highlight"... that will enable writing the callback function of the item-hover in the controller. ...
0
votes
1answer
60 views

Reinitialize an Angular.js controller

if you have a controller to manipulate $scope variables in Angular.js, is there an idiomatic way to: reset the controller's $scope, and restart controller initialization? For complex controllers ...
1
vote
2answers
207 views

ng-repeat not updating using $scope.$watch

I need some help in displaying the results of an update in my ng-repeat directive from $watch ProductsCtrl is watching for a change of product type and when it detects one it searches for Products ...
0
votes
2answers
58 views

Broadcasting across AngularJS controllers?

How do I broadcast a message between controllers? Here is what I have tried: function Ctrl1($scope) { $scope.$broadcast('Update'); } Ctrl1.$inject = ['$scope']; function Ctrl2($scope) { ...
0
votes
4answers
71 views

Unable to share data between AngularJS controllers?

I had seen the egghead.io video on sharing data between controllers, but couldn't get it to work: var myApp = angular.module('myApp', []); myApp.factory('QData', function () { return 'hello' }); ...
0
votes
1answer
36 views

Angularjs two separate ui elements communicating

I have a use case to toggle the view of a form using a button. The button is not nested in the same structure of the form, and is out side the scope of the forms controller. What is the best way to ...
0
votes
0answers
20 views

Submitting a form from an external controlller button for validation

If you look at my fiddle I'm not sure why the internal 'Submit' button triggers browser validation (as per the required attribute) but the 'External Button' doesn't? The external button calls the ...
0
votes
1answer
75 views

Controller doesn't work after URL change

In short: I have a controller that triggers some jQuery in my AngularJS web page to fade out a play button and a corresponding image. But, when the URL changes, the controller fails to work on ...
0
votes
0answers
162 views

AngularJS: Sample ToDo App - Questions and Review

I know there are tons of AngularJS ToDo apps/topics out there and I've read quite a few of them to get a basic understanding of AngularJS, how things work and the idea people put behind their code. ...
0
votes
1answer
191 views

How to access the $ngModelController from inside the Controller without a Form and without a Directive

Maybe it's a rookie mistake, but I can't seem to access the $scope.model's $ngModelController so I can grab the $viewValue from it. I have an input without a form (im using ui-mask directive): ...
0
votes
2answers
137 views

Load-time exception handling in AngularJS

I need to execute a function which is defined in controller in load-time, in order to gain json data from another place right after page is loaded. I've tried to call the func immediately within ...
1
vote
1answer
180 views

AngularJS Controller $scope not displaying variable

I am new to AngularJs. In app.js I have the following angular.module('module1', ['module2']) .config(function($routeProvider) { $routeProvider .when('/', { ...
0
votes
0answers
55 views

Share data between controllers using permalinks?

I would like to share data between controllers using permalinks, rather than signals or factories. Given a single page application, with three controllers (Ctrl1, Ctrl2, Ctrl3), and a predefined ...
0
votes
4answers
252 views

Cannot get simple push/splicing of array to work - AngularJS

Please have a look at the following Plunker project. I want to keep a list of items in a service which multiple controllers can access. In this example when you select a surname it will come up in ...
0
votes
3answers
279 views

$watch not working on variable from other controller?

I have one controller which displays a checklist, and stores the selection in an array. My other controller runs an $http.get on the array from the first controller. How do I set a $watch so that ...
2
votes
1answer
1k views

Sharing data between AngularJS controllers? [duplicate]

How do I store the items I've selected in a checkbox with other controllers? My attempt (see the plnkr for views): script.js (controllers) var myApp = angular.module('myApp', []); ...
2
votes
3answers
3k views

Simple Angular $routeProvider resolve test. What is wrong with this code?

I have created a simple Angular JS $routeProvider resolve test application. It gives the following error: Error: Unknown provider: dataProvider <- data I would appreciate it if someone could ...
0
votes
1answer
121 views

Checking for data uniqueness in AngularFire

Using AngularFire, I want to add an object to my angularFireCollection ONLY if the "name" is unique. My data is structured like so: - ClientList - dsk32923k <-Random unique ID created by ...
0
votes
1answer
802 views

Angular JS delay controller and directive initialization until data is returned from server

My AngularJS app requires some metadata from the server before it can initialize the controller and a handful of directives. I have a service to return the data but have been unable to get the ...
0
votes
1answer
47 views

Sharing a variable between controllers through a service

Here is my plunker: From what I understand, since the Service Variable being shared is an object, the object that gets loaded to the service by controller 1 should be plainly seen by controller2 ...
1
vote
1answer
73 views

What problems would I run into if I make all Data avalable to all Controllers?

My AngularJS CRUD application processes it's information over a WebSocket Server. (This was mainly so that updates from one user would get automatically pushed to all users without the need for ...
1
vote
2answers
186 views

Angularjs: models binding

I have directive which dynamically creates input tags. I need to get values of created inputs on change event. Instead of it the name attribute on $scope argument in the controller is undefined. How ...
1
vote
3answers
1k views

Angular communication between controllers and directives

I have this piece of code which allows a user to leave comments on a list of items. I created a directive and listen to keydown in order to let the user submit a comment if keyCode == 13. Not sure ...