Tagged Questions
0
votes
2answers
22 views
Slow Angularjs page initialization - long delay before html loading
I'm running an angularjs app, and can't figure out why my page is loading slowly. The css and js files all load quickly, but there is a long delay between that and when the html loads, where the app ...
0
votes
1answer
18 views
I have 2 app.run method.how to halt in first method until promise is resolved?
angular.module('app', [
... ])
.constant('AppConstants', constants)
.config(appConfig)
.run((UserService, User) => {
'ngInject';
console.log('apprun')
UserService.acl()
...
1
vote
1answer
29 views
angularjs scope array not shown when data is in
I have scope array property. I'm filling in the data by calling ajax service. What is happening is that even the data is populated in the array as expected I need to focus some other control or click ...
2
votes
3answers
45 views
Why ng-click not working when i got in $scope.variabel?
I have problem, my ngclick not working because i got in $scope.variabel controller.
<a id="data_table" ng-click="{{ item.target }}"
I think target can use in ng-click when we call {{ item.target ...
0
votes
3answers
23 views
Angular: Assign $scope value from ng-init to new variable
As per mentioned, Is it possible to assign $scope variable from ng-init to new variable?
see this plunkr
If you see on my plunker, variable $scope.adulttotTicket have value of total ticket which is ...
1
vote
5answers
55 views
Calculate total price in AngularJS
I'm trying to make this code to get the final number of the sum of all detalle.price elements. They are all numbers so I need to sum them and post the final number on sum().
<div id="pedidos_table"...
0
votes
1answer
22 views
angularjs filter multidimensional object json
I wnt to use ng-repeat to display a list filtered by an object value. Here is a plukr of my attempt https://plnkr.co/edit/vD4UfzM4Qg7c0WGTeY18?p=preview
The following returns all of my JSON names as ...
0
votes
3answers
29 views
Angular JS : Post call is going in Success as well as Error Method
I know I amy look like foolish while asking this, but I am not able to figure this out.
I have written a service which handles the post call to the server. $q service is returning the promise back ...
0
votes
2answers
22 views
angular controller scope with html
I have this code in controller `
(function () {
'use strict';
var LoginController = function($scope, $http, $timeout,$location,User) {
$scope.user = {};
$scope.flags = {
error: false,
...
1
vote
2answers
41 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
25 views
Why is my $scope not updating in my View in Angular when using $location with angular-route?
Does anyone know why my $scope.userData isn't rendering in my View when using angular-route and Angular's $location service together?
My Situation:
In the code example below, I have an index page ...
0
votes
1answer
13 views
Data not being populated in drop down from JSON Response from REST in Angular js
I'm getting a JSON value from one WebService like this
"electricity":
{ "selectedElectricityBoard":"ABCD",
"electrictyConsumerNumber":"12345",
"isElectricityBoardChecked":true
...
2
votes
3answers
53 views
NgRepeat is not updating from an updated array
I have an app that gets a collection of data (i.e. 400 objects) and stores it in an array. In my view I'm creating a kind of infinite scroll, that basically when the page loads, it insert 5 records. ...
1
vote
1answer
17 views
How to bind different scopes from one controller to the one?
I have a controller that I use in two places: in a ng-view and in a ng-include. These places are not child or parent to each other, but I want to some changes made in the ng-view affect to ng-include ...
-2
votes
0answers
29 views
How to convert the below Jquery to angular inside run block
Jquery to angular conversion needed inside run block.
html
<body class="modal-open" style="padding-right: 17px;">
Js
$('body').removeClass('modal-open').removeAttr('style');
-1
votes
2answers
38 views
angularjs pass index throuhg directive
i need help with this code.
<ul ng-init="round = 'round'">
<li ng-repeat="mesa in mesas" ng-click="selected($index)">
<div id="{{round}}"> </div>
MESA {{...
1
vote
4answers
37 views
how to get text area empty automatically when user click anywhere on the page. Angularjs, Javascript?
I'm working in angularjs project, I have one text area which gives me some result on search.I want my text area to be cleared whenever i click anywhere on the page.My code is
<input type="text" ng-...
1
vote
2answers
37 views
dynamic ng-model using multiple dropdown and ng-reapeat
Hello every one i have a language multiple selection input. On select language i need to open textboxes of selected language with dynamic ng-model.
this is my json and code.
[{"id":"1","lang":"...
0
votes
0answers
17 views
angularFileUpload don't fire event
i am trying to do a file upload with angularFileUpload module, so in my view i have something like this:
Upload image <input type="file" data-ng-file-select="onFileSelect($files)" accept="...
0
votes
1answer
33 views
Can a $rootScope variable be passed in state file - AngularJS
I'm working on an Angular project and currently am working on making the entire project configurable. I have an object which contains an array of elements, each element being an object with the ...
2
votes
1answer
51 views
Update element created by directive on change of controller varibale
I am trying to create an angular app where user can create a dynamic form. In this user can create form fields and save form metadata, which is then used to display actual form. There is live preview, ...
-1
votes
1answer
17 views
How to update the directive when the parent's scope variable changes?
Directive:
<div ng-show="{{ show }}">
...
</div>
angular.module('mymodule').directive('mydirective', [
function () {
return {
scope: {
show: '='
}...
4
votes
2answers
36 views
Angular JS passes App ID and Key with every request
I have a basic angular APP that makes a GET request call to a API URL. The data returned is in JSON format. The API documentation states the following:
You must provide your App ID and key with ...
1
vote
1answer
49 views
Differnce between $scope.Variable and $scope.Function in Angular?
$scope.some_random_variable = "random_value";
$scope.some_random_function = function(random_param){
console.log("randomness");
}
I want to know the difference in the context of digest cycle.
As ...
0
votes
1answer
19 views
Angularjs Class Confirm button
I am trying to create a "confirm" button for users of my website to see when they click on a button, and I am using an angularJS class. My code is as follows:
class TodosListCtrl {
constructor($...
0
votes
1answer
53 views
Why is $scope not working in Angular 1.6.1?
Background
After following the AngularJS tutorial on codeSchool and reading some StackOverflow questions, I decided to start using $scope in order to avoid the hassle of having to define a var self = ...
1
vote
1answer
56 views
angular 1.6.1 '&' binding issues
Problem:
When I bind '&' under ng-repeat(or without for that matter atm), I can't seem to trigger the parent scope's function.
HTML
<div ng-repeat="type in fC.types">
<repeater type="...
0
votes
1answer
16 views
Injecting $location service makes my url with fragment identifier weird
Here is my angular code
var app = angular.module('app', []);
app.controller('mainController', ['$location', '$scope', '$log', function(location, scope, log) {
log.info(location.path());
}]);
And ...
1
vote
3answers
52 views
AngularJs ng-repeat custom structure
I have a dataset like this
$scope.dataset= [
{"Name":"Alfreds Futterkiste","City":"Berlin","Country":"Germany"},
{"Name":"Ana Trujillo","City":"México D.F.","Country":"Mexico"},
{"Name"...
1
vote
1answer
23 views
Adding Form Fields Dynamically in angularjs not working
I am developing an online course application. I am trying to add form fields dynamically in my application, so that I can add more video lecture for a course. However, when I click on "Add Another URL"...
2
votes
1answer
36 views
can't pass dynamic parameter to angular directive
I just took over the frontend work of our angularjs apps and I'm stuck.
I've been creating directives to replace bloated html to make updating the frontend look easier. All was going well till I hit ...
0
votes
1answer
22 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
24 views
Add/Remove class if checkbox is checked/unchecked (AngularJS)
I need to toggle a class if a checkbox is checked/unchecked with AngularJS. My Code is working on Plunker but in my controller there is no functionality.
Here is the Plunker: Click!
My Controller ...
0
votes
1answer
29 views
Angularjs - How to set value of Global variable according to one of the response data element
I want to set the value of glovalvar according to defined in function hello
I am getting response data & according to that I want to set globalvar Value.
Here is snippet:
var app = angular....
0
votes
2answers
32 views
How to preserve scope in componentized Angular app containing a dialog that serves a custom directive
I have a question about how to pass scope to a template rendered from a directive. This seems like it should be so straight forward but somehow I am having a lot of trouble getting it to work.
My ...
0
votes
3answers
55 views
How to iterate through angular $scope variables with a for loop
I want to iterate through an array using for loop instead of using foreach in which i m not able to break the loop. But here in for loop i getting $scope.items[i] as undefined!
here i m dynamically ...
0
votes
1answer
26 views
AnularJS anonymous component replace inner scope
Hi I am using Angular with ES6, now I want to get rid of the $scope since Angular2 will not use it anymore and I want to create futureprove code,... this works:
let tab = this.tabManager.getArea.open(...
0
votes
0answers
78 views
$compile directive not hiding elements in ng-repeat
After upgrading from Angular 1.3.2 to 1.5.11 it appears my custom restrict directive is no longer working as expected. The directive is responsible for hiding elements through comparing a user's roles ...
1
vote
1answer
21 views
Directives scopes and inheritance
Could someone explain to me, why with the following code:
<html ng-app="myApp">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<...
0
votes
3answers
30 views
Angular directive not picking up the values set by parent
I have a directive that has a div, whose visibility is set by its parent. Expecting "show" to be true, but the div is still not visible initially on page load.
Directive:
<div ng-show="{{ show }}"...
1
vote
0answers
42 views
Using Resolve In AngularJS Routes to get Json data
I'm trying to get Json data in AngularJS Routes and then inject it to the controller. A resolve contains one or more promises that must resolve successfully before the route will change. This means ...
0
votes
1answer
15 views
Error: [$compile:multidir] when using multiple directives on same element
I made a form for credit cards payment which contain many validations, on the input below I try to validate 2 settings, one is the card type (visa,diners,amex, etc...) and the second validate is for ...
-1
votes
1answer
36 views
How to trigger the function after DOM markup is loaded in angular style application except onload
I need to show a Simple current time with an angular based-application.So have tried a demo.
In the body onload function execute the piece of function.
<body onload="startTime()">
function ...
-1
votes
0answers
43 views
Angular constructor function possible memory leak
In our app we use constructor functions intensively, but whenever we are initializing a scope object with new and constructor function it is placed on the Heap (Open Profiles in chrome dev tools and ...
9
votes
1answer
153 views
Angular JS : Uncaught DOMException: Failed to execute 'removeChild' on 'Node' on HTMLScriptElement.callback
I am using Angular JSON Http call. in the same When I make the post request like this :
app.service('AjaxService', [ '$http','$q','$sce', function($http,$q,$sce) {
return {
...
0
votes
2answers
58 views
Using $location.url() inside a directive not working in angularjs
I have a directive and inside it, I used the $location.url() but it seems not working, and I think I need to inject something on my app but I don't know where to inject it. By the way I'm new to ...
1
vote
1answer
45 views
angularjs country code look up from jsonfile via $http request
I am trying to look up country codes from a json file to get the full country names:
$scope.fullname = function (option) {
$http.get('files/names.json').success(function (data) {
for ...
0
votes
1answer
40 views
How to create a modal using angular components?
I'm pretty new to angular, and I'm trying to create a modal as a component (trying not to use ui-bootstrap or libraries) and I'm having trouble wrapping my head around it. My code:
App.component('...
1
vote
1answer
30 views
google map does not show properly
how to call initmap method in angularjs because. map does not show... properly when i use $scope.mymap = function(){} when i clicked refresh button its working fine, but when i change the tap, and ...
-1
votes
1answer
39 views
Angular JS live select dropdown search filter
I am grabbing some news items from a newsfeed REST API and have implemented a free text instant search.
I am now trying to implement a search from a dropdown list that works with the same data but I ...