8,923 questions
1
vote
1
answer
54
views
Why the ng-pristine class in AngularJS form always returns true
Why the ng-pristine class in AngularJS form always returns true.
enter a value in the input field and click the button, it does not return false, it returns true.
test.html
<div ng-app="...
0
votes
1
answer
35
views
Why is $scope >= 0 showing true in interpolation while empty in controller?
I'm setting a $scope variable to 0 or 1 based on a successful action and showing elements with ng-show. I'm resetting the $scope variable to empty when the step is finished. However, I have discovered ...
1
vote
0
answers
28
views
Update the isolated scope of all instanced directives
My current situation right now is rather tricky and I've been bashing my head for two days straight trying to fix this problem.
I have accordion sections in which there is a space reserved to add/...
0
votes
1
answer
33
views
How to connect a directive with a controller in angularjs?
I am refactoring some angularjs with a new directive and I am trying to access a controllers scope from the directive.
Here is the directive:
(function () {
/**
* Config
*/
var ...
0
votes
1
answer
63
views
different image url each profile (ng-repeat)(ng-src)
I want a different image url each person profile everytime they’re profile details appeared.
But what happen is it’s only targeted the last url on $scope.imgSrc so they have all same pics which is I ...
1
vote
1
answer
140
views
console.log string inside array object with angularjs
I want to console.log or target the string of an object inside array with angularjs but it doesn't work. Please help me I'm still new on angularjs.
Here is what I'm trying to do.
<!DOCTYPE html>
...
1
vote
0
answers
85
views
ng-isolate-scope in each child directive along with ng-repeat in AngularJS
The HTML template contains the nested directives. The child directive will create the element or fields based on the data injected to it. So field can be type of dropdown, input field etc. I suspect ...
0
votes
1
answer
102
views
show more in AngularJS dropdown
I have a select Dropdown created using AngularJS. We have set a limit to show the top 5 items and the remaining 5 items should be visible to the user . when he clicks the 5th item with the name "...
2
votes
0
answers
288
views
Rendering AngularJS code inside React component
Is it possible to render AngularJS component inside React component which is rendered from an AngularJS component.
I have a specific scenario where:
<angularjs-component-1>
<react-...
2
votes
2
answers
54
views
AngularJs $http post not sending data to restful api
This is my angular controller that performs the post function
app.controller ('accountsCtrl', function($scope, $http) {
this.accounts = { code:"", account_name:"", description:...
0
votes
1
answer
44
views
Filter and show results from other pages
I have a HTML page with a textbox and table to display data
<input id="search-term" type="search" placeholder="Search..." ng-model="vm.term.search" ...
0
votes
1
answer
87
views
Update directive when scope variable is updated in angularjs
I have created a directive in which i am parsing a variable "count". In my page there is a dropdown and "count" gets updated whenever dropdown value is changed. I have created a ...
0
votes
1
answer
102
views
AngularJS ng-class updating content
I've got some code in AngularJS here working half percent (I will explain) :
<button ng-class="{'svgMinus-dark': isDarkTheme, 'svgMinus': !isDarkTheme}"></button>
I also tried ...
0
votes
1
answer
128
views
While toggle, show/ hide numeric key pad changed to alpha-numeric keypad
In mobile, when inserted pin number, and then toggle show/hide then numeric key pad also changed to alphanumeric keypad.
I required, when I toggle show/hide button it should be only display numeric ...
0
votes
1
answer
46
views
How to use controller with custom directive in AngularJS?
Let's say I am using a custom directive named my-form-data:
<my-form-data info='infoObj1' template="ssc.html"/>
<my-form-data info='infoObj2' template="college.html"/>
...
0
votes
2
answers
745
views
I want to add local variable in Angular but error occur "type 'string null' is not assignable to type 'string'. typescript"
This is an image what exactly, i am facing the problem "type 'string null' is not assignable to type 'string'. typescript"
0
votes
1
answer
308
views
Checkbox to button ngmodel - which way to change my value
I'd like to edit my checkbox so I get a or an input with type=button instead.
I have for now, properly working :
<label>Afficher</label>
<input type="checkbox" ng-model="...
0
votes
2
answers
221
views
Manipulate an element that is conditionally rendered
I'm fixing a bug on some legacy Angular 1.5 code.
I have a template like this
<div id="container" ng-if="ctrl.show_container">
<div id="child"></div>
&...
0
votes
1
answer
107k
views
Angular.js unable to change scope variable value just after a different function call
I'm trying to implement a Refresh button for fetching latest search results from an external index. When I click on the Refresh button the icon is supposed to spin. My plan was to have a scope ...
1
vote
1
answer
106k
views
In an Angular.js controller's scope function code doesn't run below a $timeout statement inside
I have a button for which I have set ng-click="refresh()". The console logs before the timeout function logs correctly but the console log inside the $timeout block and after the block doesn'...
0
votes
1
answer
106k
views
ng-keyup firing but not reading properly when used with an ng-if inside a directive template
I have a directive and it works fine in a way such that when I type something the search() scope function inside my directive fires and sets $scope.query with the input text.
here is the directive ...
1
vote
1
answer
61k
views
directive with ng-if not rendering in Angular.js
I'm trying to render a directive whenever I get the search results back. My plan was to keep a scope variable algoliaSearch initially false and whenever I get back search results I change it to true. ...
0
votes
0
answers
268
views
angular.min.js:117 Error: Could not resolve 'create' from state ''
Hi I have created a angularjs+webix project wherein I will be adding CRUD operations.
I have a app.js file where I put the routing:
var app = angular.module('app', [ "webix", "ui....
-1
votes
1
answer
20
views
AngularJS does not return forward API query data
I have a little problem. The API data from the code below appears normally on the console, it returns an array with the data, but I can't return them to use them in the front-end. PS: that "name ...
0
votes
1
answer
101
views
AngularJS performing math
I have this scope function where it has a cost and a formatted value in data. That cost and formatted value are coming from an API. The formatted value can be in a different currency not limited to ...
0
votes
1
answer
38
views
How to add $watch for form validation inside AngularJS class
I try to add a $watch to check if the form is valid or not.
// testCtrl.html
....
<div class="row" ng-form="testCtrl.testForm">
...
...
0
votes
1
answer
688
views
how to disable radio button dynamically in angularjs using ng-repeat
I have developing some code in Angular JS and i need to disable radio button based on previous selection or change in text box
in JS controller:
PPCO.cusGender = [ {
id : '1',
key : 'Male',
value : '...
0
votes
1
answer
542
views
How to mock Onclose event in Jest?
I am trying to test below code with Jest framework and AngularJS 1.8.
$(".classA").timepicker({
showButtonPanel: true,
timeFormat: "hh:mm",
onClose: function () {...
-1
votes
1
answer
25
views
angularjs prints all method
I need to create a method to compone a url, So in my class I do this:
createLink take un id and return the url:
console.log("before the method");
console.log($scope.createLink )
$scope....
0
votes
0
answers
19
views
ng-href doesn't pint correct url
I need to create an url on icon to download some files. In my controller I do this
$scope.download=download;
function download(id){
console.log("Parameters "+id);
return "......"+...
0
votes
1
answer
98
views
a doesn't show href
I need to click on icon and With some api I need to download a file. So I do in my html:
<td>
<a title="download" ng-show="file.name"
...
0
votes
0
answers
66
views
Can't load a partial view from a file in Angularjs
I copied a small project from a course and trying to make it run, but apparently something is wrong with the routing or loading the .js files.
The controllers and views are in place, i already check ...
0
votes
2
answers
207
views
Angular JS if checked return value
I'm trying to return a value to my $scope depending on if the checkbox is checked in angular JS but cannot seem to do so. Is there a way to get it to work?
HTML:
<div class=" specialClause ...
1
vote
1
answer
200
views
Migrate AngularJS to Angular 8
i need to put this code line (angularJS) in angular 2+ , how can i do this?
I already do some searchs but this line is confusing me.
scope.variable.value = event.color.toHex()
Old Code:
function ...
0
votes
1
answer
232
views
How to use a string as a variable in AngularJs
How to use a string as a variable within the scope. Heres my code:
HTML (one of many divs like this where type1 can be type2, type3, and so on):
<div style="color:red;font-size:11px;">{...
0
votes
1
answer
42
views
Is there a better way to get data from localStorage after storing the data without refreshing/reloading the page
I'm trying to make a button that could store the data to the localStorage. After storing the data, I want to get the data without refreshing/reloading the page
The way I use to fix this case is, I put ...
0
votes
1
answer
110
views
value store in Angularjs Objects and outputting in View
I have a form. It contains Name , quantity & price . I want to get input from form and store in Angularjs Objects. Then i have to output to View the whole array of angular objects. I tried with ...
1
vote
1
answer
327
views
how can I change div content that has class of "ng-isolate-scope"?
I have a select tag like below
<select id="market-watch-sectors-select" name="market-watch-sectors-select"
style="height: 30px;" class="tp-w-300 tp-ma-rl-10 ...
1
vote
1
answer
36
views
How to pass a parent components function into a child and then call it from inside the child AngularJS
Function on parent
markAchievement() {
console.log("Achievement marked")
}
Binding on the parent's HTML
<mark-goal-button clickEvent="$ctrl.markAchievement()"></mark-...
0
votes
1
answer
867
views
How to reset the angular scope variable when the Html tag gets executed?
Hy, I have a variable bound to my scope,
$scope.isSuccess = {
invalidPhone : false
}
And I am using a span to display a message when the variable gets true ...
<form name = "myForm&...
1
vote
1
answer
35
views
How to use a Dynamic Variable to access Scope field - AngularJS
I am trying to have a variable string, and access the matching $scope.field but it is undefined and not returning what I am expecting. What am I doing wrong, or is this not possible?
$scope....
0
votes
1
answer
78
views
AngularJS: Why doesn't $scope detect all objects?
I am developing a web application using AngularJS. I have a problem with the $scope object.
My application is made up of many HTML pages and there is one where I use a multitude of different <form&...
0
votes
1
answer
104
views
How to Access Internal script $scope value in controller function in angular JS
Here is HTML with internal script
<html>
<body ng-controller="test">
<span> {{data.name}} </span>
<input ng-model="data.name">
...
2
votes
1
answer
597
views
Error: [ng:cpws] in formController with deep watching - angularJS 1.8.0
I have a simple scenario with a formController which has child controls (input and text area). When I use a deep watcher (with objectEquality equals true) to check changes in the whole form, I'm ...
0
votes
1
answer
214
views
AngularJS populate select using scope variable
Trying to get a simple binding going with a html select and a scope variable but the select is not populating with the right value.
<select ng-model="noOfReps" name="reps" id=&...
0
votes
1
answer
119
views
Binding child element value from Angular directive
Binding values with $scope.minutes = 1 to ng-bind="minutes" not working when I add scope: {finishcallback: "&"}, to my directive.
I'm trying to implement a countdown timer ...
0
votes
2
answers
260
views
In AngularJS, is there a way to tell what triggered a digest cycle?
I am working on a legacy AngularJS project. The code is too complicated/large to show here. But I have noticed that functions that are called when the digest changes are getting called hundreds of ...
-1
votes
1
answer
126
views
AngularJs: Input value changes in display too using ng-model. I have tried ng-value and ng-bind too
<div class="form-group">
Name <input type="text" class="form-control" placeholder="item" ng-model="shoppingItem.itemName&...
-1
votes
1
answer
336
views
How to disable Pinning in UI Grid in AngularJS
How to disable the pinning in UI Grid for AngularJs??
Even after setting enablePinning:false or enableGridMenu: false It is not work
app.js file:
var app = angular.module('app', ['ngTouch', 'ui.grid',...
1
vote
1
answer
116
views
Why does the ngModel validator code seem to run before the scope.$watch changes?
I am attempting to create an AngularJS directive with a custom validator so that I can show error messages based on the validator. However, I am running into an error because it seems that the ...