Tagged Questions
0
votes
0answers
21 views
Angular js ng-Options adding extra option as default with dynamic model name inside ng-repeat [duplicate]
I have been troubling to fix this, i just wanted my dropdown to use my supplied value as selected.
My HTML:
<select ng-init="status[lot.mid]='{{lot.status}}'" ng-model="status[lot.mid]" ng-...
0
votes
0answers
34 views
Angular JS application CPU usage is more when idle
I have noticed my angular js application is taking more CPU usage about 45% when it is idle mode. We have built much complex application using angular js V1.6.0, angular material V1.1.5 and d3js V4 as ...
0
votes
1answer
28 views
Save state of ng-change local scope in Datepicker
I have come across what seems like a very simple issue, but I cannot figure out how to fix it. I posted this question originally, but it seems the issue is with the scope.
So basically, this is what ...
1
vote
0answers
21 views
How to iterate through multiple dropdowns in a grid in AngularJS for selected value
How to iterate through multiple dropdowns in a grid in AngularJS for
selected value.Below is my code.Attached the sample grid UI .I wants to
iterate through each of the row values and form a array ...
1
vote
2answers
14 views
Multiple $http.get operatios and save the information in one $scope variable
I need to do four $http.get call and I need to send returned $scope variable to the one HTML to print all the information. In the moment I have the next code in JS:
(function (ng) {
var mod = ng....
0
votes
0answers
61 views
Angularjs: view not updating when variable changes in success method of promise
I am calling a backend API using a factory method in angular. The factory method
returns $http directly.
In my controller, I am calling the factory method and fetching the data. The factory returned ...
0
votes
2answers
38 views
Cannot read property 'length' of undefined in Angularjs 1.6.6
I have to dropdown lists and want to populate the second list on the basis of selected value in the first list. I encountered a problem in populating the first list. I use getCurrentSessionCourses() ...
0
votes
1answer
31 views
Cannot create property 'subjects' on number '1' using AngularJs
I want to select multiple subjects across one course but can't do so
I have two dropdown lists one for course selection and one for subjects selection. For multiple selection of the subjects I use ...
1
vote
2answers
37 views
Setup a attribute directive via another attribute directive is causing double bindings
Background:
I want to to use ease up the usage of the <uib-tooltip> directive in my project to mainly have translated texts and to set further options for tooltips.
For translation, I use ...
0
votes
2answers
43 views
Angular : using a service to conditionnally import modules
i have i service which i use to load a list of module :
@Injectable()
export class MyService {
public allowedModules: any = this.modulesFilter();
constructor() {
}
public modulesFilter() {
...
0
votes
2answers
49 views
AngularJS ng-click only working on second click
Attempting to collapse a dropdown menu (language selection), within a mobile bootstrap navbar. On first click, the dropdown menu with the languages opens fine, after changing languages the dropdown ...
0
votes
0answers
34 views
angularjs - mdchips (md-enable-chip-edit and md-add-on-blur) Not working version - 1.5.11
I am using this (md-enable-chip-edit and md-add-on-blur) attribute in md-chips tag code, but not working properly. How can chips add to md-chips automatically when user type phrases and leave edit box ...
0
votes
0answers
27 views
Angularjs: undefined isolated scope property when using controllerAs in custom directive [duplicate]
I am studying AngularJs for some legacy project. This seem to be a trivial example but I'm absolutely stuck. I tried to rewrite my custom directive code to use controllerAs and it does not work any ...
0
votes
1answer
22 views
Manipulating variable returned that is returned by promise AngularJS
So, I am stuck here most probably because of my limited understanding of promise Object.
my function that fetch data from factory is
$scope.getLogoFromService = function() {
console.log('...
1
vote
2answers
83 views
Angular: Call method after DOM update
I am calling a method(which calls a rest service) from html to increment/decrement a count on the screen. Now I want to call another method (i.e. getThreshold) to check if the count reaches a ...
0
votes
2answers
40 views
how to add response data to $scope object to use in ng-repeat
Hello all i was trying to get response from $http.get method and append it to $scope object but it was stating undefined. After some research and referencing found the way to assign the data to object....
2
votes
2answers
31 views
AngularJS service/factory dynamically $compile HTML from $scope variable
Attempting to consolidate a function used across multiple controllers in an AngularJS project to a service/factory that I can call using $rootScope. The goal is to change the following function:
$...
0
votes
1answer
35 views
some params dont pass value when changing state angularjs
I have weird problem, I cant pass value of some params to other state in angular js.
I tried to assign value to params for search params before doing http request
.state('tab.box', {
url: '/...
0
votes
0answers
15 views
For i elements run myApp.controller from angular JS framework using dynamic data per each iteration
How to iterate through elements having angular controllers and use dynamic data for each of the controllers? My code bellow populates all controllers items using ng-repeat directive with same last ...
0
votes
1answer
40 views
Angular 1.6 component transclusion scope
I'm trying to figure out how to get data into a component transclusion in Angular 1.6.4. The scenario has a component, a directive (not re-written as a component yet) and a service for inter-component ...
0
votes
2answers
55 views
Why can't I set input values when ng-model is used?
I'm trying to populate some default fields in a form. The AngularJS way as far as I know is to use the controller to set these values. I'm using components - which I'm starting to regret given that ...
-1
votes
2answers
80 views
angularjs does not display binding value
I have a problem with angularJS ng-model binding.
I have the following html:
<div class="col-md-12">
<form class="form-horizontal">
...
<div class="form-group">
...
0
votes
1answer
51 views
Update array object after custom filter
I have a custom filter that I'm using to aggregate a $scope object that is being used in an ng-repeat block.
my code looks like this:
$scope.myobj = isSelected ? $filter('customFilter')($scope....
0
votes
3answers
158 views
AngularJs pass model value + model name to function in controller
$scope.populateMap=[{name: "ABC", code: "123"}, {name: "XYZ", code: "345"}]
//Want to send model name + value of model Currently sending ngObject.MainObj.specificFormatObj
HTML
<select ng-...
0
votes
3answers
67 views
Dropdown not updating based on scope value angularjs
I have been working on some functionality over last few days.
Whenever I select a dropdown, index values needs to be captured. At the same time, when I click remove button, one TV should be removed ...
0
votes
2answers
28 views
Angularjs undefined err scope variable
Hi folks I'm having some difficulty with angularjs. I have lterally spent the whole day today trying to figure this out! I am new to this and really stuck so hoping someone can help. I'm getting an ...
0
votes
1answer
23 views
controller as syntax not working with angular 1.4.5 var vm = this template not showing
I had switched to controller as syntax with angular 1.5 -1.6 projects etc...
The particular project I am need to add some functionality to a angular 1.4.5 project.
Usually I using angular routing ...
1
vote
1answer
70 views
Use a scope variable inside .success and .error
I want to use a scope variable $scope.field.name when a request is done or failed. I tried to console it but it says undefined. How can I access a scope variable inside these syntax?
usiApp....
1
vote
0answers
93 views
I'm not able to send the complete form data using ng-submit. Appended div data is being sent as undefined
I'm not able to send the complete form data using ng-submit.I'm able to send the data containing even name, event status, trigger event and relay state.
The data of the appended div is being sent as ...
0
votes
0answers
17 views
Returning a value to a higher scope [duplicate]
I would like to access the data which is formed inside a function outside of its scope so that when I call the function getRentsArray i'll get the array, which is produced inside the dataFactory part:
...
0
votes
0answers
13 views
Header scope and relative controller not re-executed after location search
I am currently trying to solve if there is a best practice to manage the situation on subject.
I have some info (like page label, menu items) stored in the scope of the Header component, and when in ...
0
votes
0answers
46 views
How to import external javascript file in angulars5 component html file?
I have one component folder, is map (which is create for Google map).
This map folder contains map.component.html, map.component.css, map.component.ts files.
I have also external javascript file ...
0
votes
1answer
40 views
How to use built-in services from angularjs directives?
I'm able to get some ID from URL using angularjs built-in $location service. Now, I need to call a service with that ID when the page loads, and then response needs to be rendered in some way.
I'm ...
1
vote
1answer
64 views
Angular Radio default select and ng-if button not working
i have ng-repeat inside images and icon two radio buttons but when the page loads the default checked based on the ng-if should have to show currently the ng-if not working.
HTML
<div class="...
1
vote
1answer
46 views
Angular JS two-way bound variable does not update parent scope
My understanding of AngularJS directives is pretty poor. What I've been trying to do is use this mediaLibrary directive as a popup, so I can add media library items to a portfolio item (like images to ...
0
votes
0answers
25 views
how to set ng-change total with comma?
Hi When i use value with comma than i am not getting total value wrong how to do that?i get total wrong
i am using ng-repeat how to set on change get total convert in with ,(comma).
i have try with ...
1
vote
1answer
84 views
pass data between components with $scope.$emit()
I'm trying to pass data between two components that have the same parent component (simple version: I have child1 component, child2 component, and both of them are children of parent component). Also ...
2
votes
0answers
55 views
Angular 1 updating values of a Select
I hope there's still some Angular 1 guru around here ;)
Description
I have some checkboxes loaded via Ajax. The number, names, and status (checked/unchecked) data is loaded via ajax.
I also have ...
1
vote
2answers
59 views
In AngularJS, why can $emit events can be canceled but not $broadcast events?
Is it because of the one-to-many relationship of parent-to-child scopes?
0
votes
1answer
74 views
Javascript injected ng-click function didn't fire
I am using this bootstrap libary for our server side tables and having some problem in firing the injected JS function.
The library allows you to use the "data-formatter" to inject/format the html ...
0
votes
3answers
32 views
AngularJs $scope parameter name
I'm quite new to AngularJs. In initial chapters itself I see $scope being used, like inside a controller.
<script>
var app = angular.module('app1', []);
app.controller('ctrl1', function($scope) ...
1
vote
1answer
61 views
AngularJS - $rootScope.$on - Multiple execution
In my $onInit() I pick up the propagation event:
$onInit() {
this.$rootScope.$on('CANCELLED', (event) => {
this.EventService.getEventsCurrentUser('own')
.then((result) => {
...
0
votes
1answer
22 views
How to give accordion in ng-repeat in angular js according to click?
In this code when I am clicking on span ng-click="click_subcat(opp.ct_nm); it is loading the content in <span ng-click="click_pdms(opp.sbct_nm);" style="color:white;cursor:pointer">{{opp.sbct_nm}...
-1
votes
2answers
72 views
AngularJS $http.get(…).success is not a function? [duplicate]
I'm trying to update code from angularjs 1.4.8 to 1.6.6, this means that i'm getting an error as .success and .error have now be deprecated...I've tried googling and following existing examples on ...
0
votes
0answers
20 views
How to include an angular-ui/ui-bootstrap directive within my directive
Using AngularJS ~1.5, I'd like the outer scope (my directive) to be available to the inner directive.
Assume a simple template like:
<h1>{{info.title}}</h1> <uib-something ngModel="...
0
votes
2answers
39 views
AngularJS: Error: [$rootScope:infdig] - Call function in AngularJS view
I wrote a controller containing this function:
$scope.getItemName = function (id) {
sgcdata.get('item', {
_id: id
}).then(function (dataItem) {
return dataItem[0].brand_name + ...
-1
votes
1answer
46 views
ng-click is not giving any response while hitting web api
The html page is here with the whole code.
<body ng-app="mymodule">
<label>Search:</label><input type="text" placeholder="Search Here" ng-model="search" />
<table ...
1
vote
0answers
35 views
AngularJS - When exactly is directive scope data first bound to the DOM?
I have a general understanding of how AngularJS processes directives however I'm unsure of exactly when data for scope properties is being bound to a corresponding expression in the directive's HTML ...
1
vote
3answers
46 views
$apply from factory in angularjs
I am fetching data from websocket in a factory. Every time a message arrives I update it.
In my controller I have bound the same inside the $scope. However when the websocket message comes, UI doesn'...
0
votes
0answers
44 views
Pass data to transclusion scope in Angularjs
I'm trying to pass data to transclude scope to make variable existing only in there. I mean I'm creating component:
.component('testComp', {
bind: {
collection: '<'
},
...