1,242 questions
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
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 ...
0
votes
0
answers
39
views
Why the value of my service is undefined when it's called out of $http
This is my service
app.factory('checkMembership', function ($http) {
var membership;
return {
setIsMembership: function () {
$http.get('api/User/checkMembership').then(...
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
2
answers
103
views
How to make directive use the controller specified in directive attribute?
So I have a directive:
<directive data="user" templateUrl="./user.html" controller="UserController"></directive>
I want that directive to use the controller ...
0
votes
1
answer
59
views
Passing service call from directive to controller in angularJS
I have a directive, who receive a file to upload in httpPostFactory service and php code
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.3/angular.min.js"></script>
...
1
vote
1
answer
126
views
How to pass data with Angularjs
How do i pass data from the controller to a component to show to the user?
app.js
(function(angular) {
'use strict';
angular.module('app', []).controller('MainCtrl', function MainCtrl($scope, $...
1
vote
1
answer
193
views
AngularJS - How to change components controller dynamically?
I have an angularJS component and I manually set the url for a link.
But I want to change this url after blogposts is loaded in a different method.
HTML:
<a ng-href="{{ $ctrl.readMoreUrl }}&...
0
votes
0
answers
638
views
Angular JS controller is not working in IOS 14
Angular JS controller is not working in IOS 14. But its working below IOS 14.
App shows white or blank screen. I don't have any issue with splash screen.
Controllers and templates are working fine in ...
1
vote
0
answers
44
views
Unable to pass data to a controller inside a component in AngularJS
I have following component
componentsModule.component('detailComponent', {
templateUrl: 'detailTemplate.html',
scope: {},
bindings: {
textParam: '='
},
controller: ['$...
0
votes
1
answer
342
views
In Angularjs to assign ng-model for dynamically and read the values in Controller function
I am trying to create a new rectangle when the user clicks add button. This rectangle would also have an input field and select for these fields I am trying to assign the ng-model dynamically and read ...
0
votes
1
answer
1k
views
how to make certain options bold in select using angularjs filter and ng-options
I am using the AngularJS ng-options to populate certain select element. I would like to make some options bold and make them disabled. I am trying to achieve this using the filter along with ng-...
-1
votes
1
answer
320
views
How to enable CORS in AngularJs? [duplicate]
I am trying to consume a ZOOM API POST method using angularJS:
/webinars/{webinarId}/panelists
When I run the solution locally, my angular controller, returns an error:
Zoom provides the code to be ...
1
vote
1
answer
145
views
How to call an angularJS function from javascript?
I need to call an angularJS function from a javascript function. This is my javascript function:
function callAngularFunction(userid, serviceid, system) {
angular.element(document.getElementById('...
0
votes
1
answer
103
views
AngularJS expression not working with adding controller
When i added ng-controller to my index.html, the expression show up as {{name || "Hello"}} and {{ age || "my friend" }}. After i removed the ng-controller, expressions aslo cannot work.
it is the ...
0
votes
1
answer
51
views
Are controllers always awake?
I guess awake isn't the right word. Say I have a multi-page, large AngularJs application. Is the controller of a page that isn't active right now awake? For example, if I wanted to call a function of ...
0
votes
0
answers
20
views
how to make sure that data assigned to a variable before going through the controller?
The code fails because it is waiting for view model which has quite a big size data (that's why I put $onInit but it seems not working). Once I debug it and after a certain period of time, the code ...
0
votes
1
answer
172
views
Accessing the checkbox checked from the controller in angularjs
There are a couple of checkboxes and a button. When i press the button need to know which all checkboxes are selected in the controller.
I have a controller
Mcontroller
where i have $scope....
-1
votes
2
answers
137
views
Angular generated project, unresponsive controller [duplicate]
I'm sorry for the broad question but I'm having a hard time pin pointing my problem.
I use the "ng new" command to generate a new angular project, but when i try to utilize controller in the project ...
0
votes
2
answers
1k
views
custom directive to mask sensitive data while keeping the original value
Using: angularjs 1.4.
I need to write a directive that hides sensitive data (replacing the middle section with asterisk '*') for ngModel and ngBind, but I'd also need to keep the original, unmasked ...
0
votes
0
answers
535
views
AngularJS unable to perform file upload [duplicate]
I am doing a file upload in angularjs. I am unable to get the file object content before sending to my back-end.
XHR, headers:
XHR-Header
I have no idea why because I can get the content in my logs.
...
-1
votes
1
answer
233
views
AngularJS Unable to display upload file logs [duplicate]
I am trying to create a file upload function using angularjs which will just accept the file and send it to the server side (Django). To ensure the file upload function is working fine, I've placed ...
0
votes
2
answers
824
views
AngularJS file upload Error: $injector:unpr Unknown Provider
I am trying to do a file upload using angularjs. But I am getting this error for the past few days and I am unable to resolve:
angular.js:13920 Error: [$injector:unpr] http://errors.angularjs.org/1....
0
votes
1
answer
133
views
AngularJS component binding a function
Let's say, we were trying to delete an item from the list using the web api.We had created a child component named as remove-item using parameters - item and onRemove.On click of a item,we would like ...
3
votes
2
answers
979
views
A controller with this name is not registered -- Error: $controller:ctrlreg
Property Binding | AngularJS
We were trying to use property binding in AngularJS Directives,but the problem raised the error stated as
The controller with the name counterController is not ...
1
vote
1
answer
78
views
Controller is not registered error after adding ngRoute `.config`
Controller is not recognizing - AngularJS error
I've a controller defined in controllerPloyee.js called controllerPloyee which was working before i added the ngRoute and made to route. The error that ...
0
votes
0
answers
332
views
Import JS class inside AngularJS Controller
I have two separat JS-files: an AngularJS(1.4x) Controller someController.js, and custom-class.js, which contains the class CustomClass.
I would like to access CustomClass and its functions from ...
0
votes
1
answer
1k
views
The controller with name is not registered when loading the html through template
I am currently trying to change my web app from routing through mvc to SPA, where all different will be loaded in single main page. For this I am using ngview directive. This is the main page -
<...
0
votes
1
answer
55
views
Question about $controller service in AngularJS documentation tutorial
This code is from https://docs.angularjs.org/tutorial/step_02. I was just wondering why the scope.phones.length property is 3 instead of 0, since scope is an empty object. I am not sure what this line ...
1
vote
1
answer
199
views
Controller inheritance in Typescript with minification causing Error: $injector:unpr Unknown Provider
UPDATE 2019/07/16
My issue is actually caused by the inappropriate use of $inject. I used it as private $inject in api-service.ts but it should be public static $inject = [...]. When uglifying, it ...
0
votes
3
answers
251
views
How can I use the same controller in multiple places without creating new instances of it? AngularJS
I am essentially trying to create html component blocks that can be used in a WordPress page editor. The issue that I am running into is each block is using the ng-controller directive to get access ...
1
vote
1
answer
292
views
Is it necessary for converting all angularjs controllers into angularjs components(v1.5+) for making the hybrid app work?
I have a pretty large AngularJS(v1.5) application which contains numerous controllers. I want to migrate the app to the latest Angular version(v7) using the upgrade module which runs both the old and ...
0
votes
0
answers
63
views
How to Access directive data from a controller from a seperate file
Access directive data from a controller from a separate file. Wanted to access the data from SheetJSImportDirective which is the $scope.$apply function that contains $scope.opts.data. The $scope....
0
votes
2
answers
84
views
Unidentified ng-controller issue in AngularJS app
I'm trying some initial stuff to get used to AngularJS. My current source is SoloLearn. I tried to recreate their app, which adds +1 to a counter when a button is clicked.
I have tried checking the ...
0
votes
1
answer
35
views
Inter-controller communication between date picker components
I would like to link two date picker components in AngularJS. Basically, I use two input fields to select a date range. As soon as the user selects a start date, the date picker for the end date ...
1
vote
2
answers
91
views
Uncaught Error: [$injector:nomod] while Angularjs separating code into Controller and Service files
I'm trying to split the code into Controller and Service files as below.
Module.js
/// <reference path="../angular.js" />
/// <reference path="../angular-resource.js" />
var ...
1
vote
3
answers
182
views
$scope is not defined in script 2
Unable to fetch ng-change selected value from the dropdown.
I'm trying to pass the selected value from the dropdown to API call in script 2 as below, but unable to do so.
In the chrome developer tools ...
0
votes
1
answer
548
views
How to inject parameters into an inline controller function in $uibModal
I'm having a problem with $uibModal's open function, specifically injecting my parameters properly into an inline controller function.
Being the angularjs noob that I am, I've tried several things, ...
0
votes
0
answers
54
views
AngularJs 1.x: Remove dynamically created scope and de-register controller
I created a scope and controller dynamically from my code (usually from a provider) as given below
var controllerFn = function ($scope) {
/* scope functions and variables */
$scope.$on('...
0
votes
1
answer
2k
views
Why doesn't Chrome DevTools show all the properties of an object?
Here is a screenshot of Chrome DevTools, caught on a breakpoint.
As I indicate in the annotations, the Watch pane shows that the variable markerClusterer has a property clearMarkers, but in Scope ...
0
votes
2
answers
124
views
use a directive with public scope as a isolated scope
Some time ago I have written a custom directive and it is now used at many places inside the code (not possible to change it anymore).
It has a public scope and that was fine until today. Now I want ...
0
votes
0
answers
88
views
Need a static unique identifier from an angularjs controller
I've got a series of controllers that make a common call to a function in a parent controller. The behavior of that function will depend on which controller calls it. Currently, I handle this by ...
0
votes
1
answer
35
views
angularJS validate input field with the help of $emit and $on
I am creating a web app in which I want to validate some of my input fields
so I am using $emit and $on to keep it short
I created a directive which looks like this
angular.module('myapp')....
1
vote
2
answers
91
views
set focus to textbox from angularJS controller
I am creating a web app in which I am using angularJS, I have a jqueryui datepicker , which looks like this
<input type="text" ng-model="rc.reg.mddoj" ng-blur="rc.dojChange()" title="Date Of ...
0
votes
1
answer
45
views
Add ngModel directive to dynamic element in Javascript
Is there a way to use javascript to apply the ng-model directive to a created element? In the code below, I want the new select element to be bound using ng-model to a scoped variable inside the ...
0
votes
1
answer
186
views
AngularJS directive can't find required controller
The gist of this is that, in the code below, I need 'modalDirective' to access the list of elements to create, which lives inside 'modalController'. I also need 'modalDirective' to create an HTML ...
0
votes
1
answer
950
views
Jasmine AngularJs How to access Controller's properties
This is my AngularJs code, I would like to write a unit test which should call variables and functions inside the controller function.
For example, I would like to expect whether the abcCode is ...
0
votes
1
answer
91
views
AngularJS Error, "Cannot read property of unknown"
I am trying to create a factory to retrieve weather data for a simple web page I am creating but, I am getting stuck when trying to call the function in the factory. I have fallowed Dan Wahlin's ...
2
votes
0
answers
230
views
How to wait till the execution of angular js controller is completed
I have created two angular js services as given below:-
var app = angular.module("myApp",[]);
app.service('myServices',function(){
var officeMasterData;
//In this function I fetch the ...
1
vote
1
answer
309
views
AngularJS 1.6.9 controller variable bound to service variable doesn't change
I have 2 components which are both accessing a service. One component delivers an object and the other one is supposed to display it or just receive it. The problem is that after the initialization ...