Tagged Questions
0
votes
2answers
22 views
How to access a global scope object inside an Angular function?
In the following controller, I have defined $scope.dataSourceFactory. I initially had var dataSourceFactory = ..., (not using $scope in defining or using it later in ...
0
votes
0answers
7 views
Change minimumDate of angular UI Datepicker
My problem is as follows; I have set a datepicker like this:
<div ng-controller="DatepickerDemoCtrl" class="row">
<div class="col-md-6">
<p class="input-group">
...
0
votes
1answer
12 views
AngularJS transclude but keep the directive's scope
Is possible to do this in Angular? If
<div ng-controller="MainCtrl" ng-init="name='World'">
<test name="Matei">Hello {{name}}!</test> // I expect "Hello Matei"
<test ...
0
votes
0answers
12 views
angularjs data inconsistency
I am trying to use a value from a parent scope in a directive but it looks like I'm dealing in quantum physics territory: If I look at the content I want from the scope it seems to vanish
...
0
votes
2answers
15 views
Scope not shared across directives
I have 2 directives on the same tag, <settings> and <modal>. settings provides a template, while modal creates an isolated scope:
jsfiddle
var app = angular.module('app', []);
...
1
vote
1answer
20 views
AngularJS: Objects inside nested directives getting undefined?
So, I have two directives, one that has a template file, which contains another directive of the same type.
The first directive looks like:
.directive('billInfo', function () {
return {
...
0
votes
1answer
8 views
Angularjs Bind variables into external css file
i'm trying to figure out how to bind angularjs scope vars into external css file the problem i think is the curly braces here is what i'm basically trying to do:
.css_class {background:{{ ...
1
vote
1answer
27 views
$emit from child controller works, but $broadcast from parent scope doesn't
When I call $scope.$broadcast none of the events my children are listening to are getting triggered. A simplified example is below:
HTML
Below is a simplified example of what I'm trying to ...
0
votes
1answer
23 views
$Scope in a nested Accoridon
I am using UI-Bootstrap with AngularJS and there is this simple Accordion Menu. I tryed to nest them. This works so far, but I can't get the scope of the nested.
ng-click also won't work, guess ...
1
vote
1answer
22 views
How to call function in ng-click which is defined in factory service
How can I call the function in ng-click which is defined inside a factory service,
app.factory('MyFactory', [function () {
return {
setTest: function(test) {
alert(test);
...
0
votes
3answers
28 views
How do you propagate scope values from directives to the controller?
I have a complex data structure that requires lots of inline editing. To make the code easier, much of the breaking down of components over this data structure has been placed into nested directives.
...
1
vote
1answer
32 views
Directives with Isolated scope versions conflict
In my Angular app, i have a directive "editable". It written on Angular version 1.2.0-rc.2 and worked well, but when I upgraded framework to version 1.2.13 - directive broke. I checked capability with ...
0
votes
1answer
37 views
Angular JS custom table directive
In the project I am working on I have a lot of serial true/false data that needs to be displayed in different ways. I have been working on a directive that will allow me to pass in the model, the ...
2
votes
2answers
61 views
Angularjs directive with isolated scope needs clarification
Edit:
There is a functional example in this plunker:
http://plnkr.co/edit/GFQGP0q3o9RjLAlRANPS?p=preview
Outer scope has $scope.name = 'Donald'
All directives are declared as:
<directive-name ...
0
votes
2answers
74 views
Should I load 10,000 rows into memory in my Angular app?
I'm building a customer management tool in Angular.js to load 10,000 customers right into the $scope. From there I can search up and manipulate any of the data without having to make calls to the ...
0
votes
1answer
18 views
Creating Angular objects on the parent scope from a directive
I'm building a simple form in Angular that allows the user to add or remove fields as they please. I've modeled this system off of an array of objects. When you begin the array is empty. When a row is ...
0
votes
2answers
41 views
AngularJS - Can't access retrieved JSON data in the view
I just spent the last hour searching and reading a bunch of similar stackoverflow pages and was unable to find a solution. I'll try to be as descriptive as possible, but please let me know if I need ...
0
votes
1answer
19 views
Converting Date to String in dhtmlxScheduler and AngularJS
I am using dhtmlxScheduler with AngularJS, and I'm looking for a way to convert a Date object to a string. I am only concerned with converting the start date, and not the end date in the following ...
0
votes
0answers
37 views
Using object in multiple nested angularjs directives
I have a list of person objects. I have a directive for displaying some read only data about the person and nested inside it a directive that acts as the toolbar for actions on the person (delete, ...
0
votes
1answer
36 views
AngularJS directive for dependant select element
I'm trying to write a directive for dependant select elements. The relationship is Country > States > Cities. When element with class country get changed I should update element with class ...
1
vote
4answers
191 views
Passing local variable to directive in AngularJs
I have a controller that feed a repeater with an array:
demo.controller('MyCntl', function ($scope, $compile) {
$scope.items = [
{ name: 'Diego' },
{ name: 'Darko' }
]; ...
1
vote
1answer
39 views
what is the difference between $scope.$root and $rootScope ? angular js
i see in controllers $scope has $root, what is this? and how is it different from $rootScope which can be injected in the controller.
0
votes
1answer
21 views
Access UI elements from Angular controllers
I have this HTML:
<select id="common_commonbundle_standard_address_country"
ng-model="common_commonbundle_standard_address.country"
required="required"
tooltip="País"
...
1
vote
2answers
42 views
Counting the total of nested ng-repeats and updating multiple controllers/models in angularjs
In my current project I have a two nested ng-repeats, where the outer ng-repeat provides an argument the inner ng-repeat needs to filter out the data + some additional custom filtering on the ...
0
votes
0answers
23 views
Singleton angular js services - per injector?
Referring to this link Services as singletons
This says in the last paragraph:
Services as singletons
Lastly, it is important to realize that all Angular services are application singletons. This ...
0
votes
1answer
84 views
AngularJS - View not updating after set new value to array
I have 2 controllers, the first (EventosListCtrl) works for me perfectly, shows me the list of data indicated by GET, but when I pressed the button to bring the data to show in the second controller ...
0
votes
0answers
16 views
Watching for non scope or undeclared var in dependant selectors in AngularJS
I'm working on Symfony2 project and I'm using also AngularJS. So I'm using Symfony2 Forms to build forms and this is how my form code looks:
public function buildForm(FormBuilderInterface $builder, ...
0
votes
1answer
38 views
Angular nested filters in controller
I have items to search by title(string) or tags(array of strings)
items:
[
{
title: 'My title',
tags: ['tag1', 'other']
},
{
title: 'Misc',
tags: ['tag1', 'notag']
}
]
I ...
3
votes
2answers
32 views
angular.js $destory event - should I manually unbind?
I'm trying to figure out if angular base automatically unbinds watchers and scope events bound with $scope.$on(...) or $scope.$watch(...) when scope is destroyed?
Suppose I have following code:
...
0
votes
2answers
50 views
Angularjs - Directive controller loading faster than app controller - value undefined
I have a controller that makes an xhr request to retrieve some data..
$scope.mbProductImages = [];
$http.get('product.json').success(function(data) {
$scope.productDetails = data;
...
0
votes
0answers
17 views
Notifying $watchCollection of a scope change triggered from $watch
How can I 'notify' a $watchCollection of the scope change, caused by a $watch without adding the $watch-ed model to the $watchCollection.
Example code below - or http://jsfiddle.net/Js2ZH/
HTML
...
0
votes
1answer
32 views
dependency injection issues factory object null in angular application?
I am trying to learn angular and having some difficulty with injecting my factory class called 'courseService' into my controller called CoursesController(coursesController.js). It does not always ...
0
votes
0answers
33 views
Why items are not rendered?
I have this function in my controller:
// Get countries
$http.get(Routing.generate('countries')).success(function(data) {
if (data.message) {
$scope.message = data.message;
} else {
...
2
votes
4answers
44 views
Function callback in directive with original binding
Passing in a function to be called back on init to a directive, this function is noted by a string attribute which is then parsed and used. The issue is when used, the function binding is no longer ...
0
votes
2answers
30 views
How to have a value passed to scope from outside the controller?
I am new to angular world and I have function which is loading the html inside perticular div on load and then controller gets initialize. I want to make single var available inside the controller so ...
2
votes
0answers
48 views
Custom filter overrides original data or causes infinite $digest loop
Initial Situation
TL;DR
I want to filter a nested array with a custom AngularJS filter. Unfortunately not only the data for ng-repeat are filtered but the original object from $scope too.
I have a ...
1
vote
1answer
31 views
Values from Controller to Service to Directive in Angularjs
my AngularJS web app needs (as you may guess) to show modal popups sometime. Before learning AngularJS I used to centralize my code using Namespaces, and I tipically put all the UI stuff in a proper ...
2
votes
3answers
71 views
Pass data to angular ui modal (lightbox effect)
Problem:
I want to create a modal lightbox using the Angular UI Bootstrap modal
Details:
I have built a photo grid using ng-repeat. Each repeated photo opens the modal using the open() method. I'm ...
0
votes
1answer
23 views
Angularjs displaying ng-repeat results under a field
repet to display results in a input field.
Here is the data (being returned from controller scope is companycodes)
company code
abc 111
abc 10012
abc 6434
xyz ...
0
votes
0answers
30 views
generate unique element IDs in nested ng repeat
I am facing problems generating unique IDs for nested ng-repeat blocks in angularJS. Also, I need to manage a common ngModel for all radio buttons with unique ngValues.
The basic layout is as ...
0
votes
1answer
50 views
Angularjs: How to update parent scope in directive without using isolated scope when the attribute is passed in within ngRepeat
I have a simple angularjs directive that uses JQuery to convert a template to a draggable dialog
var myApp = angular.module("myApp", []);
myApp.controller('myCtrl', function ($scope) {
...
0
votes
3answers
29 views
Keeping track of whether a user has edited a form
I am loading a form with customer data in it. When a user edits the customer data, I want to be able to track the changes so that if a user changes url, I can pop up an alert to ask the user whether ...
1
vote
2answers
44 views
infinite digest issue with Angular
So i'm trying to add an attribute to an ng-repeat using some logic inside my controller. I'm getting an infdig error. I'm pretty sure I'm getting the error because i'm trying to change a scope value ...
1
vote
2answers
36 views
How to get the item count for an object attribute on ng-repeat
My application is using Bootstrap 3 and AngularJS. I am trying to count the number of farmers markets for each state based on the filtered results on ng-repeat.
My JSON data looks something like this
...
1
vote
0answers
47 views
Event with reference dom in angular directive
I have multiple dom like
<custom>sample text1</custom>
<custom>sample text2</custom>
And they will compile with transclude to
<custom><p ...
1
vote
2answers
80 views
How to access Angular scope in Select2 “change” handler?
I would really like to know how to set the right property for the right object.
Currently in the "change" event handler I have no knowledge of the scope I'm in. Effectively I don't know which ...
-1
votes
0answers
33 views
Angular array push fails and remains empty
Please consider code below. I am actually expecting to have values in array "$scope.xaxis" as I see the console log populated with records (strings).
$scope.xaxis = new Array();
if ...
0
votes
1answer
31 views
using angular and datatables, one implementation shows data while the other does not
so i have a reusable component for making some generic datatables with angular. https://github.com/lostrouter/angular.datatables. however, i found my self constantly repeating my code creating crud ...
2
votes
1answer
40 views
Why is my AngularJS $scope not working?
I am very very new to Angular and still very much a newbie to Javascript. I followed a tutorial, but the result is not working in my project.
Tutorial: ...
0
votes
1answer
17 views
Specifying controller in directive definition does not create new scope
I ran across a rather un-intuitive aspect of AngularJS directives and I'm curious if there's a logical reason for this behavior. When I specify a controller in a directive's definition:
...