The angular-controller tag has no usage guidance.
0
votes
1answer
38 views
How to stop angular from creating multiple instances of a controller every time we use $state.go
I am using UI router for angular routing. Everytime $state.go() is called a new instance of the controller is being created. I have $rootScope events here. So everytime I want to print any log (using ...
0
votes
0answers
12 views
How to use Angular controller in Zeppelin
I'm new to Zeppelin, recently I'm study how to use Zeppelin in my current project. I want to add a Angular controller in Zeppelin paragraph. But it's failed. Can you please give me some hints how to ...
0
votes
1answer
23 views
Angular controllers and directives getting values from controller into directive
I have a directive in my angular website that builds a page header, in that page header I am wanting to show the user's first and last name. I am wrapping my entire application in a MainController. My ...
2
votes
1answer
20 views
Angular 1.x : Specific Scenario When To Use Controller / Service
Let's say, In a web app, a particular JSON is frequently used across multiple pages. for e.g
{
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "...
0
votes
1answer
24 views
Angular Translate - Update translations executed via $tranlate.instant() in controller at runtime
I am using angular-translate and trying to change languages at runtime (without refreshing the page) using a select menu (on-change). However, the front end of the application I'm working on gets its ...
0
votes
1answer
40 views
Updating shared data between controllers
I'm trying to implement data sharing between AngularJS controllers, I've followed an approach to share a service instance between two controllers and there's no problem with it, the data from a ...
0
votes
0answers
20 views
memory leaks in angular js application
We tried 'Recording allocation timeline' for our angular 1.5 application and found wired behavior for almost all our controllers . I can see several instances of each of the controller.
Does it mean ...
0
votes
3answers
25 views
how to send value of variable from ajax to another controllers
here is my controller:
.controller('loginCtrl', ['$scope', '$window', '$cookies', '$http', function($scope, $window, $cookies, $http) {
var frm = $('#loginForm');
frm.submit(function(ev) {
...
0
votes
1answer
22 views
Common POST Function for Angular through Services
We are building an angular app which is having multiple functions based on GET, POST and PUT methods.
For Example
this.updateEmp = function (employee) {
var response = $http({
method: "...
0
votes
1answer
33 views
Error: ng:areq Bad Argument Argument 'ClientCtrl' is not a function, got undefined.
I am still a new programmer with Angularjs and I am having an issue adding a controller to my site. I have two other controllers connected to the site and working fine but this one for some reason isn'...
0
votes
2answers
28 views
AngularJs : The code i have written doesn't work and Code in comment works. where am I going wrong. Please Explain
I'm learning AngularJS from W3SCHOOLS, and I am facing this problem over and over again!
In the following code uncommentated lines of controller code are written by me and
multiple comment lines ...
0
votes
0answers
9 views
how to import Vegas background slideshow from node modules
I have installed vegas using npm and followed steps from http://vegas.jaysalvat.com/documentation/setup/. How can I import Vegas background slideshow to my angular controller.
import $ from 'jquery';
...
0
votes
1answer
78 views
How to pass data between different modules using service having two different controller with different modules?
What I am doing here is, I have created one service to share the data between controller but the problem is both the controller is having a different modules. so my doubt here is, how can i make ...
1
vote
0answers
31 views
Issue in service creation for passing data between controllers?
I want to pass the data from login controller to verify-mobile controller and for that I have made one service that will handle the data communication between controllers. but I got injector error
...
0
votes
3answers
29 views
Should I have more angular services or controllers?
I am developing an angular web game where I have a bunch of quests that use a single html template for the view. The problem I have is how to organize the Angular code.
Should I have only one ...
0
votes
1answer
53 views
Angular JS controller doesn't work with routing
I’m working with Angular JS 1.3, I have problem with ngRoute, in the code below
angular redirects to "apex/" + pathTemplate + "_product" (the page works in Salesforce container) but control doesn’t ...
2
votes
2answers
52 views
Angular Controller as ES6 Class: “[ng:areq] Argument ***Controller is not a function, got undefined”
Attempting to build a basic Angular todo application w/ES6. As far as I can tell, the controller should be registering, but I continue to get the title error when routed to the associated state.
*...
0
votes
0answers
15 views
Organize code with prizm of provider. Angularjs
Good afternoon. Please tell me how to organize my code. I have a model which has many subsidiaries submodels.Child submodel enters the scope of the controller(with scope.$watch). For example item 1.1.
...
0
votes
1answer
53 views
I wrote an if condition inside angularjs controller, not working properly
I wrote this if statement by myself to differentiate USD and LKR, the values are not coming properly. Is this if condition correct?
$scope.$watch('currencyVal', function () {
...
1
vote
2answers
56 views
Angular Controller/Factory calling API in wrong order
I have the following factory and controller:
(function () {
'use strict';
angular.module('app.core')
.factory('Auth', ['$http', function AuthFactory($http) {
return {
...
-2
votes
1answer
32 views
How to use Ng-repeat within controller not in view
According to the below json. If I call this scope in controller, I am getting output :
[{"code":"USD","value":"0.00670000"}].
I want to get only value but within controller I want to do. Does ...
0
votes
1answer
38 views
Stop event listeners on '$destroy'. TypeError: $on is not a function;
I'm trying to stop all event listeners while scope is destroyed.
I get this error:
TypeError: vm.$on is not a function;
Neither vm.on(..) works
angular.module('app.layout')
.controller('...
0
votes
0answers
30 views
Angular NG6 rootscope variable value is undefined
Im having trouble in accessing a value in rootscope, I have created a variable named ismobile and add it to rootscope.
class NavbarController {
constructor($window, $state, $filter, $rootScope, $...
0
votes
0answers
55 views
How to load data into angular ui-grid with typescript?
I would like to load data from a service into a ui-grid in this controller
namespace app.notifications {
export class NotificationsController {
/**
* Stores the dependency injection classes.
* @...
0
votes
1answer
52 views
How to create Child Controller Angular Js
define([], function() {
function myCtrl($scope,$http)
{
$scope.test = "Course Man";
}
myCtrl.$inject=['$scope','$http'];
return myCtrl;
});
We have separate file for ...
0
votes
2answers
31 views
Ionic - AngularJS: calling methods via template outside of Controller
So, here's a sample code:
<div ng-controller="MyControllerOne">
<span ng-click="foobar()">Click Me!</span>
</div>
Can I, from that template, without changing controller, ...
0
votes
0answers
80 views
Argument is not aNaNunction, got undefined on a Controller
So I'm getting this error, and I've been looking at the other questions but nothing worked.
Here is where I declare my module:
(function () {
'use strict';
var app = angular.module('...
0
votes
2answers
23 views
Angular Copy clicked object to another controller
I have a list of items and if I click on one of them the current object should be copied to another controller and displayed there, I've created the factory to save the clicked item, but is not being ...
1
vote
2answers
23 views
App Doesn't Load When Controller is in Separate File
This is an addition to my question: AngularJS Doesn't Resolve An Array of Objects
As I've stated in my final edit:
I have resolved this by placing controller in the same file where app
is ...
0
votes
1answer
26 views
AngularJS $timeout returning bad request
I am trying to use the $timeout and use the following code within my controller:
$scope.counter = 0;
var updateCounter = function() {
$scope.counter++;
$timeout(...
1
vote
1answer
61 views
change ng-model value using filter Angular js
Is it possible to update ng-model value using filter on input field? I have this text field:
<input type="text" ng-model="dateOfJoining" ng-value="dateOfJoining | date:'dd-MM-yyyy'">
in ng-...
0
votes
2answers
17 views
$scope assignment works in one case but in other
First Case
angular.module('tss.application').controller("UserspaceController", function($scope, $http)
{
$http(
{
url : "/dirlist",
method : "...
1
vote
1answer
39 views
AngularJS isolate directive - data not binding in .controller (but works in .link)
A custom directive was created in AngulerJS 1. It has in isolate scope, and is data-aware (gets data from server API). Its definition looks like this:
var dirJobView = function ($location, ...
0
votes
0answers
61 views
Show number of API hits on view with Angular JS
I am a beginner at Angular JS and trying to understand this concept. I have a JSON API which consist of product list and have used $hhtp.get to fetch and show the output in the view.
All i want to ...
3
votes
3answers
70 views
angularJS- initiate HTTP Call from a controller failed
I am building a website using angularJS and PHP. Website has many pages like- Home, About Us etc.
So, I have created a common header for the website which I included in my HTML view like this:
<!...
1
vote
0answers
31 views
How i check if a dynamically loaded Angular Controller has been regestered
I have created an application that loads routes dynamically and in turn there controllers.
My controllers are added using an ng-repeat in my index file and then bootstrapped manually.
The issue i ...
0
votes
0answers
25 views
Best practice when using functions from Angular Service in a controller? [duplicate]
Let's say you have a factory in your angular JS app called accountService, that contains a bunch of functions that make calls to the api to the login, logout, change password, etc.
Now the factory ...
0
votes
1answer
45 views
Getting ngModel value in controller - AngularJS?
The player's name is alerted once submitPlayer is clicked, and I want the corresponding player id too.
HTML
<div class="row">
<div class="input-field col s12">
<input id="...
0
votes
0answers
17 views
Angular controllers
I have a Controller in which I have a variable $scope.tasks. In my nested controller I obtain some data from backend and want to assign that response which is say $scope.editedTasks to $scope.tasks in ...
0
votes
1answer
43 views
Angular.js dependencies order for third party libraries
First of all all third-party libraries should be wrapped in angular module so it can be added as a dependency to other angular modules.
for example
angular.module('lodash', [])
.factory('_', ...
0
votes
3answers
42 views
Angular - changes to directive controller's scope aren't reflected in view
Changes to my scope variable foo are getting updated in the html. When that value is change inside the scope of a directive's controller, it isn't updating in the html.
What do I need to do to make ...
1
vote
1answer
74 views
How to inject ui.grid at controller level?
Can we Inject 'ui.grid' at controller level not at Module level.
something like this.
.controller('gridController', ['ui.grid', function ($scope) {
}])
Error: [$injector:unpr] Unknown provider:...
0
votes
1answer
33 views
How to use promises between angular factories and controllers? - Having annoying issue - Thanks
Factory:
function thingyFactoryFunction($http) {
return {
search: function(city, state) {
$http({
method: 'POST',
url: 'http://localhost:7500/search',
...
0
votes
1answer
57 views
Set $scope variable inside Angular Service
I have this Service in AngularJS:
this.getProductsSiteService = function(idSite)
{
return $http.get(BASE_URL + 'obtener/productos/sitio/'+idSite);
}
It works fine. I use the method below for ...
0
votes
1answer
60 views
Angular js directive scope value binding with controller undefined
I've created a simple directive that displays a chart.
I have an angular directive with an $http request. I have to store the response into my $scope and access this $scope value to my link directive ...
0
votes
0answers
18 views
calling self. function inside var function jasmine
I have a controller as below
myapp.controller('MyCtrl',function(){
var fun1=function(){
myservice.fun1().success(function(response){
self.fun2();
}).error(function(err){
...
0
votes
1answer
79 views
How to change form value from different controller in AngularJS
I have following html (sample)
<div ng-controller='ctrl-1'>
<form>
<input type='text' ng-model='name'/>
</form>
</div>
And js file as:
app.controller('...
0
votes
1answer
122 views
How to use md-select using array data?
I am using angularjs and angular material to design my web page. I am unable to show the values of option present in an array.
My index.html
<md-input-container class="md-block" flex-gt-sm>
...
0
votes
2answers
65 views
How to test self. angularjs controller functions in jasmine
I have the below code inside my controller
Controller:
self.DoSomething = function () {
self.x="hai";
self.y = function (id, data) {
self.x="hello";
}
}
$scope.Call=function(){
...
0
votes
2answers
79 views
testing .success and .error of service in controller jasmine
I have a call to service's function in a controller. Below is the code
Service
(function () {
'use strict';
angular.module('MyApp')
.service('MyService', ['$http', function ($http) { ...