Tagged Questions
2
votes
0answers
58 views
How to reduce watchers in AngularJS 1.3 - performance issue
An internal web software that is being used by a warehouse. It contains a table of orders with items that need to be scanned and prepared for delivery.
It has 3 sorting options, 12 main and secondary ...
0
votes
1answer
14 views
Angular Js expression in expression
I have an angular expression
<td>{{quote.IsRequired ?'Yes':'No'}} </td>
It will show yes or no value in table.
I have one more expression {{quote.Type}} , this will have any "String"
...
1
vote
2answers
570 views
AngularJS ng-model not doing two way data binding
I have a label with an input box like so:
<label class="item item-input">
<input type="text" data-ng-model="description" placeholder="Add a Description!">
</label>
As you ...
0
votes
1answer
326 views
Passing Controller's $scope variable to nested directive's controller
I'm having trouble passing a scope object from one controller to a nested directive's controller.
I have a directive (child) within another directive (parent), the parent directive and its controller ...
0
votes
2answers
93 views
Model updates in directive do not update view
angular.module('myApp')
.component('sideNav', {
controller: function SideNavController($scope) {
$scope.navigation = {};
$scope.click = function(key) {
$scope.navigation[key] = !$...
0
votes
1answer
40 views
$scope variable doesnot bind with view after getting updated
I have a $scope variable isAuth that is a boolean which will be true when user signs in. And I use this variable to show a footer using ng-hide. I have a route definition with $routeProvider service ...
0
votes
1answer
45 views
User input not binding from $scope.$watch
Just getting started with Angular and I've spent the last 2 days trying to figure out how to bind data from a new search through a service. I had the search working before with the following code ...
0
votes
1answer
63 views
AngularJS data-binding doesn't work when input updated by third-party libraries
The form is using jquery.placepicker to get addresses from a google map
and ng-bs3-datepicker to set the date. I found that the data isn't updated in the controller's scope. How can I trigger the ...
0
votes
0answers
39 views
Undefined two-way binding object to save in angular
I posted my code below. In a modal I have a editDependent as model in a modal div which is in a page employee.html which is routed in a inner div ui-view. How to perform the two-way binding on the ...
0
votes
1answer
1k views
ES6 class calling a method within a class with bind vs call?
I have a class written in ES6 and I have a directive "action" which needs to access a controller value called "selected". This controller value "selected" is updated by another directive "grid". ( 2 ...
1
vote
0answers
85 views
Class directive dynamically adding another directives
I'm trying to create an angular directive (as a class) which dynamically adds a angular ui tooltip to the same element. I've tried following, which unfortunately does not work.
MyApp.directive('...
1
vote
0answers
90 views
How can an angular controller access HTML without a model or Jquery?
I am working with some legacy code and am confused about the way it's set up. I've only ever known of enabling communication between HTML and JS with classes, id's, elements, etc, when using jquery or ...
1
vote
1answer
409 views
Why does my scope binding to a service array not update when the array gets replaced
I have a scope binding to an array stored in a service.
When the array changes, the scope notices the change and updates the values in my template.
However, when the Array gets replaced by another ...
0
votes
1answer
675 views
Angular Custom Directive .match is not a function
I am trying to create a simple angular radio-group directive. the component will be passed an array of strings, an id, and an attribute to bind the selected option to. When I run my code I get the ...
1
vote
3answers
508 views
AngularJS Printing text if checkbox is checked
I am trying to print text on the page in a <h1> tag depending on whether a check box is checked or not.
$scope.EmailMe = function(email) {
if($scope.emailchecked == 1) {
$scope....
0
votes
0answers
17 views
Angular databinding based on dataset rather than location
I have a dropdown that should display a name underneath after the selection. However, the data is grabbing by where it is in the array instead of referencing the data around it.
Here is the plunker ...
1
vote
1answer
771 views
How to evaluate expression runtime in angular
i am new in angular and trying to evaluate expression at runtime in angular but failed.this is my code
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/...
0
votes
2answers
780 views
Value in view not updating after $promise is resolved
I have a value in my view that is not updating after a service method is called.
Here is the relevant code in the controller:
$scope.remaining = 20;
AcctService.getCurrentCount.get(...
3
votes
2answers
64 views
Angularjs not updating variables
I want to display/update the calculation answer directly without the need of aditional buttons.
Or do i need a function and button to apply the changes?
<div ng-app="myApp" ng-controller="myCtrl"&...
0
votes
3answers
4k views
AngularJS updating child component when parent element changes
I'm working on a an existing Angular application (1.4.3) and I'm trying to break things up into components that can be more re-usable and allow for a better upgrade path to Angular 2.
I've got a ...
1
vote
0answers
191 views
Scope not updating in link directive on ng-submit
I can't get the scope object to update on submit. The submit function is called, but the console shows the object does not update. I have tried most similar problem-solutions I have found.
The ...
1
vote
3answers
344 views
what are the directives that support one way binding in angularjs
In angularjs what are the directives that support oneway binding. ng-model supports two-way binding
Does ng-bind,{{ }} expression supports one way binding ?
1
vote
1answer
41 views
Inser output from ng-repeat in a directive
I have a template in which I repeat trailer objects in my $scope.trailers, and add a angular directive that creates a embeded youtube players into the template,
.container-info
.trailers
%ul....
1
vote
3answers
425 views
Angular directive scope sharing between two directive
I am working on a project where I have one controller and two directives and I need to share the scope between them all, I have created plnkr here.
The code structure is as following:
Main ...
2
votes
2answers
763 views
Update UI based on change of a directive attribute in AngularJs
I am struggling with data binding in AngularJs.
I have the following piece of markup in .html file that includes the custom directive:
<my-directive ng-repeat="i in object" attr-1="{{i....
1
vote
2answers
221 views
Set root object for angular binding
Is there a way to bind a root object into an html tag and have the children of that tag bind to the properties of that object? In the same way that ng-repeat works but the object in question here is ...
0
votes
1answer
398 views
How to watch variable in service from controller within AngularJS application?
I'm writing app functionality, that set loading gif when request are executing (in learning purposes). I use AngularJS 1.4.5, "Controller as" syntax and John Papa style guides.
So, I wrote an ...
0
votes
1answer
167 views
3-Way-Databinding for Single Document instead of Collection using Meteor and Angular
According to the documentation, it is possible to bind a collection to the Angular Scope with
angular.module('socially', ['angular-meteor']);
angular.module('socially').controller('...
3
votes
1answer
258 views
How to fix unexpected arguments passing from a function being on ng-change for select list?
http://plnkr.co/edit/fFSoLmPFDBfNc2oOczZr?p=preview
Directive code
.directive('inputSelect', function() {
return {
templateUrl: 'someTemplate.html',
restrict: 'E',
...
2
votes
3answers
1k views
Update variable without scope.$apply() in AngularJS
In my project, a canvas element shows a joystick. Through mouse/touch events, the canvas is updated to look like the user is moving the joystick. This works fine. The coordinates are held in an object ...
1
vote
1answer
41 views
Angular JS $scope, databinding, and variables changing.
So I have an APP I'm working on in Angular JS v1.4.0 and I'm running into a scoping issue. There's a section that has a form that needs to be submitted, but the data needs to be modified before its ...
1
vote
2answers
1k views
Two-way binding with parent.parent scope
I have an issue where a directive with an isolate scope is not making changes via binding to its parent.parent scope.
In summary, I would expect that changes made to a property in the directive's ...
1
vote
2answers
361 views
Angular watch factory value
Say i have the following factory:
app.factory("categoryFactory", function (api, $http, $q) {
var selected = null;
var categoryList = [];
return {
getList: function () {
...
0
votes
1answer
2k views
Bind AngularJS variables into inline script tag
I have the need to add in some items from my scope into some inline script I need to run on my site.
From what I have tried in my demo it doesn't look possible to use the values from my scope in ...
0
votes
2answers
64 views
What is the angular way to have a variable in a service automatically update when a datepicker in a directive is updated?
I want to use a datepicker to select a date and then to have it manipulated in a service in order to generate more dates.
I can retrieve a variable from a service and assign the datepicker value to ...
0
votes
1answer
73 views
Redefined Variable Doesn't Bind in AngularJS
I'm new to Angular, and I've run into a bug in creating an app where a single AngularJS bind doesn't update when the bound object value changes.
It's a scaled down version of the app, so that's why ...
0
votes
1answer
33 views
Why does Angular databinding against factories only work with functions?
I have the following code:
angular.module('app')
.controller('controller', controller)
.factory('storageFactory', storageFactory);
function storageFactory() {
var message;
_message = ...
0
votes
4answers
191 views
parent with child directives won't work when creating new scope
I have created a parent directive which can retrieve data from a given URL, this works fine.
As second step, I want to distribute the data among several child directives, such as:
<parent data="...
6
votes
3answers
834 views
AngularJS : use a variable into <div>
i have a controller named "HomeCtrl" which calculates the total number of user's into the {{total}} binding variable, like this:
.controller('HomeCtrl', function($scope, $http){
$scope.total = 0;...
0
votes
2answers
2k views
What gets added to $scope.$$watchers by default in Angular? And what triggers $digests?
I'm reading Build Your Own AngularJS and have a decent understanding of how $scopes, $watch and $digest work. I understand how it works when you add your own $watches and and call your own $digests. ...
1
vote
1answer
81 views
How to prevent scope binding when edit?
I loaded data into a table and am doing edit and delete. I created sample plunker to explain my main problem. Please note that this is not the real application code that I'm using.
My edit function ...
1
vote
1answer
28 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 = {
...
1
vote
2answers
6k 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 ...
2
votes
2answers
9k views
AngularJS - Upgrading v1.2.5 to 1.3 to use bind once
I am trying to improve the performance of my ng-repeat's. I have upgraded my project to use library v1.3.0 (main lib and route).
I am trying to use the bind once as here: Do bindings nested inside of ...
9
votes
2answers
13k views
ng-click on firing on mobile or tablet devices
On page load i have a controller that calls a service and then binds the returned data to some $scope.objects:
app.controller("MainController", function($scope, $http, serviceGetData) {
...
0
votes
1answer
35 views
Angular JS: attribute not influenced by $scope…?
Angular newbie here.
I have the following div:
<div id="mainfr" data-curpos="dy[ {{curPosObj.dy}} ]" ...>blah blah </div>
And in my controller I have:
var nxtest = angular.module('...
3
votes
1answer
987 views
Binding doesn't update when the original object changes
I think I have misunderstood something about how data-binding and scopes work in Angular, or maybe I have some misconception in Javascript in general. I hope somebody can help me.
Let's say I have a ...
1
vote
1answer
65 views
AngularJS : Bind to transclusive directive without isolating the scope
Let's say I have some angular markup like:
<custom bindTo="modelProperty">
<!-- Trascluded content. -->
</custom>
Would it be possible for the custom directive to bind using ...
0
votes
1answer
116 views
Angular Isolate Scope and Attributes
In the following plunk:
http://plnkr.co/edit/ss3HTb?p=info
I am attempting to bind an attribute to an isolate scope. However, it is not working. I'm wondering if anyone knows why that is?
I've ...
1
vote
1answer
4k views
Angular JS Two-Way Binding with Dropdown in Grid
I am using AngularJS as well as Parse and the Parse-Angular-Patch. I have a sample app that does basic crud.
When I click the edit button. The Salutation loses it's state.
Here's the relevant HTML:
...