The angularjs-controller tag has no wiki summary.
0
votes
1answer
21 views
Angular variable's default scope?
body(ng-controller='bodyController')
.div(ng-controller='divController')
h1 {{someVar}}
In the above html(jade), to which scope does someVar attached? to $scope of bodyController or ...
0
votes
1answer
9 views
SharIng scope by declaring ng-controller='sameController'
.div1(ng-controller='sameController')
// some content
.div2(ng-controller='sameController')
//other content
Do the two divs share the same '$scope'?
0
votes
0answers
29 views
Setting Model in AngularJS Control Not Updating View (something…)
I am experiencing issues with updating values in my AngularJS controller and having them properly reflecting in my model.
I have the following form in my view:
<form name="formSignIn" ...
0
votes
1answer
34 views
AngularJs - Error: 10 $digest() iterations reached. Aborting
I am trying to create a Metro Tile type grid with Angular, to achieve this i want each of the tiles to be a different colour. So my plan of action was to create a function that would randomly pick a ...
0
votes
0answers
25 views
Nested directives - cannot pass args to controller method from child directive in Angularjs
I'm having some trouble with nested directives in angularjs. I want to call a controller method from a directive within another directive and am trying to pass arguments to it, however they are ...
0
votes
2answers
32 views
Initializing AngularJS service factory style
I have a service that retrieves data via REST. I want to store the resulting data in service level variable for use in multiple controllers. When I put all the REST logic directly into controllers ...
0
votes
1answer
25 views
prevent default on submit :- Angularjs
I want to prevent-default action of http-post to '/signUp' if e-mail is null upon filling form.
Controller Code:-
$scope.signUp = function() {
if($scope.email = null);
preventdefault;
}
...
1
vote
2answers
29 views
ngInit not working asynchronously(with $q promise)
Edit:
Plunker is working, actual code isn't:
http://plnkr.co/edit/5oVWGCVeuTwTARhZDVMl?p=preview
The service is contains typical getter\setter stuff, beside that, it functions fine, so I didn't post ...
1
vote
2answers
36 views
Evaluating expression in ng-controller
My Javascript
var app = angular.module('Demo', []);
app.controller('DemoCtrl', function ($scope) {
$scope.expr = "Test"
});
app.controller('Test', function ($scope) {
$scope.HELLO = "HEllo ...
0
votes
1answer
17 views
How to bind a transcluded template to a different controller?
I'm trying to pass a template through a directive to a dynamic controller (known at runtime from the directive perspective).
Something like this:
<my-dir ctrl="PersonCtrl">
...
0
votes
1answer
67 views
Argument 'PricesController' is not a function, got undefined
I am relatively new to angularjs so please bare with me. I have looked at a lot of examples related to setting up the app, and everything I'm doing seems correct but I'm still getting the error ...
0
votes
2answers
31 views
$watch's object not triggered when attributes are changed
I have one object:
$scope.obj = {bar: 'bar value', foo: 'foo value'};
and I want to to know if bar, foo or both change.
I'm doing this:
$scope.$watch('obj', function() { console.log("watching ...
2
votes
2answers
58 views
Loading Modules in Angular
I'm new to AngularJS. In my efforts to learn, I've relied on the AngularJS tutorials. Now, I'm trying to build an app using the AngularSeed project template. I'm trying to make my project as modular ...
0
votes
0answers
25 views
ng-repeat load new updated array model but do not clear the previous value of array in template
I have a list of articles, every article has a list of comments with user.name and user._id of that comment. Click to each user, it shows a chat box to send message to that user. Everything is ok with ...
0
votes
1answer
41 views
Organizing a AngularJS Controller
I'm new to the AngularJS world and come from a Backbone background. So far I'm loving it but there is quite a big difference in terms of architecture practices between the two ( someone should write ...
0
votes
1answer
17 views
Add more locals in controller
Here is a simple example of constructing a controller. What if I need to add the $location in my controller?
e.g.
function ExampleCtrl($scope,$location){
$scope.data = "some data";
...
2
votes
2answers
61 views
AngularJS common controller functionality - mix-in where needed or define on $rootScope?
I am using v1.2.0 rc2 of AngularJS and want to know what is the best method to provide common functionality to multiple controllers.
I have the following validation functions that I want to use in ...
0
votes
2answers
76 views
access parent directive's controller by require: '?^…' recursively
I'm trying to reach the controller of a parent "box" directive recursively:
<body ng-app="main">
<!-- no nesting: parent is the just body -->
<box></box>
<script ...
0
votes
0answers
59 views
Dynamic routing with dynamic controllers in AngularJS
I am currently using require.js and angular. Since I have a very long list of custom views, each for a different task, I've cooked up a way of including them dynamically using requirejs.
First a ...
0
votes
0answers
76 views
How can I write generic Angular JS controller logic?
I'm using Angular JS to work on a proof of concept for a SPA that needs to be able to handle dynamic form generation. This project is essentially an interview style application that will have a user ...
0
votes
2answers
31 views
AngularJS controllers communication
I'm not sure I'm doing what I need in the right way... I have 2 controllers:
SiteMenuCntl and DashboardCntl
SiteMenuCntl is bound to a UL tag, and it's the menu of the site. By default it's hidden, ...
3
votes
3answers
91 views
Angular ngController vs Controller constructed within Directive
I'm wondering what the use cases are for these two methods of creating a controller:
Using ngController:
myApp.controller('myController', ['$scope', function ( $scope ) {
}]);
Constructing the ...
1
vote
1answer
25 views
Communication from Diretives to Controller in Angularjs
I am new to angularjs. I have following code , Now i want to access object of map in controller. here i am not able to know, how to pass it to controller?
My Custom Directive :
...
0
votes
1answer
73 views
Pass Arguments from directive to controller function
I've seen lots of these questions but haven't found a solution that works. here is a fiddle that doesn't work but should.
http://jsfiddle.net/cdparmeter/j2K7N/2/
Controller:
$scope.foo = function ...
0
votes
1answer
81 views
Trigger the $scope.submit() event of blueimp in angular programmatically
When I use the submit() event of blueimp file uploader within the DOM, everything seems to work fine. i.e.:
<span class="btn" ng-click="submit()">Go</span>
However, calling ...
3
votes
0answers
37 views
The difference between a compile/link function and a controller function in AngularJS? [duplicate]
I'm trying to write my own AngularJS directives. I think I understand the difference between the compile and link functions. This video clears it up nicely.
But I'm not sure now that I understand the ...
2
votes
2answers
40 views
AngularJS Directives and the Model
I'm not sure this question's been asked, but is it good practice (not ok-to-do) to mess with the data model from an AngularJS directive?
For instance, if in my controller I have some object, like:
...
0
votes
2answers
43 views
Issues indirectly updating ngModel from ngClick
I have an ngRepeat that populates a list of customers, shown here :
<div ng-repeat="terr in terrData.data">
<div class="customer-row" ng-click="clickCustomerSelect(terr)">
...
1
vote
1answer
195 views
AngularJS Drop down values change Dynamically
I am creating two dropdowns using AngularJS, and append data in them through Angular controllers. I want to change the 2nd dropdown values when change occurs in first one.
I create the example, but ...
1
vote
0answers
115 views
AngularJs :: Load Data In DropDown on base of other Dropdown
Load data in my first dropdown from AngularJS then on the basis of this dropdown i want to generate next dropdown with data from another controller
<ul data-role="listview" data-inset="true">
...
2
votes
1answer
55 views
What is the difference between passing a function and array as an AngularJS controller?
Both of these work, but what is the actual difference between each implementation? I'm sure there is a logical reasoning behind each method, and I wish to be enlightened.
...
0
votes
2answers
60 views
AngularJS Where can i access the scope of a loaded controller?
Where can i access the scope of a loaded controller ? I like to have something like a event after the scope has been initialized for a controller to predefine the model for the view.
Is there ...
1
vote
3answers
335 views
How do I use $rootScope in Angular to store variables?
How do I use $rootScope to store variables in a controller I want to later access in another controller? For example:
angular.module('myApp').controller('myCtrl', function($scope) {
var a = ...
0
votes
1answer
45 views
AngularJS cannot seem to take a variable duration for a $timeout
I am trying to implement a function within the controller which will be incharge of showing various notification to the user.
the problem is that I want the duration to be a function parameter, and ...
0
votes
1answer
43 views
How to access the data returned by roles by factory in the controller?
app.factory('myService', function ($http) {
var serviceurl = 'http://localhost:12345/Area/Controller/Action/';
var roles = [];
function getRole(id) {
//alert(id);
$http.get(serviceurl + ...
1
vote
1answer
125 views
Shared Variables between Controllers with a Service in AngularJS
I'm trying to share a group of variables between my controllers, but it does not seem to be working, I already followed some example but can't make it to work.
Below is the JavaScript
...
0
votes
1answer
99 views
Re-binding a tree (Wijmo tree) with AngularJS
I am fairly new to AngularJS, and really struggling to re-bind a Wijmo tree (or even a tree implemented using UL and LI elements wth ng-repeat) with new data on changing of value of a Wijmo combobox ...
0
votes
1answer
53 views
Angular access controller scope from nested directive
this fiddle represents what i am trying to do:
http://jsfiddle.net/d1001001/dwqw6/.
The grid directive needs to grab some data from controller, but since it's nested in the modal directive, which has ...
1
vote
1answer
83 views
What's the right way to wait for ng-init values to be set?
I have an "ng-init" directive in my HTML that initializes the value of "data.id" in my Angular.js data model. Let's say for now that I can't change how this works.
Now, I want to make an HTTP request ...
0
votes
1answer
101 views
angular JS service is null inside the controller
This is my first learning project for angular js.
i have created a controller(EditEventsController) and a service(eventData).
Code for the EditEventController is
'user strict'
...
0
votes
1answer
60 views
Dynamically loaded AngularJS not working
I'm just looking to try AngularJS as it looks very promising.
I am using fancybox to load my pages in my current application like so:
$.fancybox({
'href' : 'pages/example.php',
'type' : ...
0
votes
1answer
130 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
435 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
102 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
234 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
30 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'> - ...
2
votes
1answer
463 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
1answer
727 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
31 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
106 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', ...