346 questions
0
votes
3
answers
601
views
What is the accepted way to handle getting Angular Form Control values into the template?
The Problem
In Angular when you call a function such as a public get value() { ... } in a template any time the template is re-rendered the function will be called again leading to many different ...
0
votes
0
answers
37
views
Angular JS Controller not rendering table
I am stuck on a problem.
I want to take first and last names as Input show them as full names and add them separately on a table by push method. Full name function is working properly but another ...
3
votes
1
answer
54
views
Get data between two controller that there are no any relation them in angular.js
I have two controller that they aren't any relation and want to know smtg in controller1 when happen a change in controller2.
like this: Update smtg in controller2 after changing controller1 to ...
0
votes
1
answer
64
views
DeepCopy in Angularjs?
Is there a way to add the $scope data to another $scope without changing the values from which it is added? Currently, I have created one button and whenever someones click on it the following action ...
1
vote
1
answer
344
views
Angular variable returns undefined in some points of the controller but on others it returs his value
Im working a controller where I get an array of values from a service. When I have the values from the service I set the value of a variable as the first element of that array then I do a console.log ...
0
votes
0
answers
640
views
Show a select field with options YES/NO without having a default option selected
I'm working on angularjs and I have a field that has two options YES/NO.
When someone will fill this field I need to show the two options but non of them is selected. So it will look like an empty ...
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">
...
1
vote
2
answers
88
views
How to pass a parameter in AngularJS
I have a list of products in Angular JS and when I click the link for a certain item I want to sent the index of that product to a new page where to get all the details for that item (category, price ...
0
votes
0
answers
31
views
Sum of returned "fields" in ng-repeat showing in HTML page
I have an angular-js controller returning json data from the database.
I bind the returned data to the $scope.details var in the success function.
In the HTML I use the NG-REPEAT to show all the ...
0
votes
1
answer
46
views
AngularJS controller prepended by a ? In Chrome
Occasionally when I update some code in my controller and then check it in chrome it will throw a controller not registered error and also a syntax error. When I look at the chrome source files the ...
0
votes
2
answers
292
views
How to use Angular $scope.variable from controller 1 in ng-class of div using controller 2
I have 2 controllers boxController.js and homeController.js. On box.html page I initialize the boxController.js. Now, I need to use ng-class on box.html page but the variable I need to use inside ng-...
0
votes
1
answer
2k
views
Calling method from grandchild component in angular 7
I have an angular 7 application and trying to call method of Parent from its grandchild component. I have Modal Component which is the grand child component. I am trying to call the method from there. ...
0
votes
1
answer
177
views
ng-click doesn't invoke method inside angularJs controller
I am trying to create an angular application from scratch. I have been trying to solve this for hours now, but I couldn't make it work.
All the following files are placed inside a parent folder.
...
1
vote
1
answer
266
views
Getting Error :[$injector:unpr] Unknown provider: dataServiceProvider <- dataService <- firstctrl
I am new to angular and creating my first application using angular in it and getting this error.
"[$injector:unpr] Unknown provider: dataServiceProvider <- dataService <- firstctrl"
Below is ...
0
votes
1
answer
276
views
Open multiple instances of same partial view and controller in angularJS
I am developing single page application using partial views and angularJS.
I am having a scenario where I have to open same partial view multiple times with different data.
I tried to make ...
0
votes
0
answers
166
views
Uncaught ReferenceError: MainCategoriesListController is not defined error is coming
The error:
MainCategoriesListController is not defined
is coming at its declaration only ,i.e, angular.module().controller(~~,~~).
Also, in categories state, in the resolve property when i try to ...
2
votes
1
answer
2k
views
Angular - pass additional form data to the server
I have a basic Angular form with prod_name, prod_desc, prod_price, those of course I want to send to the server when form is submitted.
However I want to send additional peace of data and I don't ...
2
votes
0
answers
79
views
Angularjs locale in Controller
I am new to UI world and currently working on Localization. I was able to translate the texts which are in HTML files but came up in a situation where Controller returns a list of values which is ...
0
votes
2
answers
53
views
Push data from controller to JSON in service
I am facing a problem in pushing data value to a JSON which is in service. I have less idea of pushing data to service in AngularJS.
Example I have created a function to show year and time in ...
3
votes
1
answer
2k
views
Angular 6 - How to change a component's value in its template on a IF condition
I'm trying to display or hide the below 'separator-container' if any one of the row data satisfies some specific condition (as in 5th line of code "myConditionCheck").
I tried achieving it by having ...
0
votes
1
answer
57
views
Unable to fetch angular controller's data into HTML
I am using Angular 1.6.
I am trying to fetch x and y positions for an SVG element from a component controller.
this.painterModel = [];
var imageRef = {};
imageRef.path='assets/images/sample.png';
...
3
votes
1
answer
3k
views
AngularJS pure ng-controller lifecycle hooks
Suppose a pure AngualrJS (1.6.x) controller declared using ng-controller directive (in contrary to a component controller).
Does it have lifecycle hooks like $onInit or $onDestroy?
0
votes
1
answer
145
views
Setting ng-bind value dynamically through controller, not using an expression
<div ng-app =“App” ng-controller = “ctrl”>
<input ng-model = “firstName”>
<p ng-bind = “showFirstName”></p>
<script>
var app=(‘App’,[]);
app.controller(‘ctrl’,function($...
2
votes
2
answers
744
views
AngularJS: Currency filter not displaying symbol using code
I am trying to display currency symbol using currency code dynamically.
It's not working. It worked on my older projects. I am not sure what changed in currency filter.
This is my html
<h2>{{...
0
votes
0
answers
433
views
how to use StreamController to broadcast in AngularDart
I am learning StreamController. There are three components: ComponentA, ComponentB, ComponentC. What I would like to implement is: if user click any one component, funcA(), funcB(), funcC() are called ...
3
votes
1
answer
383
views
AngularJS - Inject $factory into controller
I have multiple factories registered, say Circle, Square and Triangle, and a controller called ShapeController. Inside of ShapeController, I'm trying to retrieve one of the factories using its string ...
2
votes
1
answer
231
views
AngularJS $watchCollection not being called
I am trying to use $scope.$watchCollection from a controller to monitor a service I have. When my controller is originally called, the watch gets called, but every time after it doesn't.
My ...
0
votes
1
answer
3k
views
Google places API automatically get place from a string
In my Page I'm querying my backend to get an address and placing that address in my input.
Now using Jquery I get that input value and want to get the place from google places api.
//placing value ...
0
votes
0
answers
58
views
how to use Module name with $scope?
Is it possible to use Module name and $scope variable?
For example my module name is app
I want to use in controller like this
$scope.app.variableName = 'hello';
1
vote
2
answers
405
views
How to transition an angularJS application to angular
I currently have a simple search functionality defined in AngularJS (https://next.plnkr.co/edit/qpyvZuvI8vw8q6on?open=lib%2Fscript.js&preview) but I'm hoping to migrate this feature into an ...
0
votes
1
answer
689
views
Not loading test cases generated in karma-jasmine framework
I am trying to write a simple test case for a controller, but it doesn't give any error as well doesn't load the test case I have written.
app.js
var myApp = angular.module('myApp',[ 'ui.bootstrap',...
0
votes
2
answers
51
views
Not able to access angular directive's isolated scope
First Directive:
app.directive("myDirectiveOne", function($rootScope){
return {
templateUrl : "/custom-one-html.html",
restrict: "AE",
replace:true,
scope: {
...
0
votes
1
answer
227
views
Converting date to dd-mm-yyyy with AngularJS and ASP.NET
I am getting following date while returning from angular code 1/1/0001 in controller. date is displayed in proper format like below
My filter, which is in angularjs
myApp.filter("DateOfBirth", ...
1
vote
2
answers
520
views
AngularJS read data from controller to table
I simply try to read out data from the balanceTableCtr and show it in the balanceTable. But it just shows me an empty table.
balanceTableCtr.js:
(function () {
'use strict';
angular.module('...
0
votes
1
answer
130
views
ANGULARJS :How to send radio button value from controller to another?
I have two radio buttons redirecting to same application.jsp page but I just want to add/remove few fields on that application based on button that is clicked.
For example- if btn 1 is clicked i want ...
0
votes
1
answer
632
views
angularjs external controller file results in error 'angular is not defined'
I have following controller defined in an external file but when I try to run my node server I get 'angular is not defined' error.
vaultcontroller.js
angular.module('demoapp.vaultcontroller', [])
....
0
votes
1
answer
35
views
Make Controller get information from a directive
I have a directive, that in its scope has an object. This is static information right now and I want to make this visible for every controller in my app. Is there any way to do this?
2
votes
2
answers
3k
views
How to create formControlName dynamically in Angular 4?
I want to create formControlName dynamically, here is my code in component,
CONTROLER CODE
ngOnInit() {
this.rForm = this.fb.group({
question_type_id: this.fb.array([]),
});
for (let i = ...
2
votes
1
answer
3k
views
AngularJS How to access Controller scope from Directive
I am trying to access parent controller scope from a directive function. When I try to get the value of $scope.$parent it returns me the object. But when I try to access any variable from that object ...
1
vote
3
answers
3k
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-model=...
-2
votes
1
answer
83
views
many functions in a controller on AngularJS?
<!DOCTYPE html>
<html ng-app="myApp" >
<head>
<title>myApp.html</title>
</head>
<body ng-controller="myCtrl as vm">
&...
0
votes
3
answers
759
views
i need to store the value in angularjs function
im having ng-change function in the name of myFunc() to store the response from html listitem.
the respose value is getting saved in the local variable of the function but when i refresh the ...
0
votes
1
answer
423
views
Multiple controllers for a single template view
In angularjs, I have already made view templates consisting of multiple controllers. Now while routing can we specify multiple controllers to one template or there should be only one controller for a ...
0
votes
2
answers
323
views
How to use an AngularjS View (.html file) without using it's tags
Inside a big AngularJS application I have a new HTML template file and a controller for it, and I'd like to build a layout the designer gave me using this temporary view, since I'd like to be able to ...
0
votes
0
answers
35
views
Angularjs late control load
Is it possible to load the angularjs controller late? like...
function doLateLoad(){ app.controller('ctrl', function ($scope) {}) }
doLateLoad();
I get ctrl is not found error for some reason. If I ...
0
votes
0
answers
1k
views
add selected value from dropdown list to database angularjs php mysql
i have a dropdown list and i can access the selected name through ng_model directive(selectedName) but My problem is when i try to pass the selected option value to the database it pass a null value ...
1
vote
2
answers
4k
views
How to create service and use it in controller
I am having a simple login form and I want to validate user upon successful HTTP request and it works fine. however, I've written all the code in the controller itself and I don't want that. i am new ...
0
votes
1
answer
1k
views
Which emoji plugin can be used in Angular with controller and services?
I want a emoji picker in side of a textarea. I have already tried emojioneArea but I have been stuck because in textarea I have ng-model and ng-change attribute but after implementing emojioneArea ng-...
0
votes
1
answer
72
views
Angular 1 Error: [ng:areq] - Controller inside Controller
I'm trying to use angular rating from this http://plnkr.co/edit/kFKejRU0G2wmkD7GlNdH?p=preview
Here is my Angular code:
var ProfileApp = angular.module('ProfileApp', ['ui.bootstrap']);
ProfileApp....
-1
votes
3
answers
880
views
AngularJS controller success, window.location not closing modal or refreshing page
I want the current page im on to refresh and close the modal after I submit a form...I think I got it to refresh by adding a changing variable to the end of the url, but the modal 'grey out' aspect of ...