In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
17 views
Using scope which can be shared between all components in Angular
I have simple controller with one method:
app.controller('MyApp', function($scope) {
$scope.myMethod() {...}
}
I have also many components for input fields (for example for text input, number ...
0
votes
1answer
26 views
Ng-include losing scope
I need to show different forms depending on user clicking different buttons. The user should be able to switch different forms and read previous data inserted. Unfortunately it seems like ng-include ...
0
votes
3answers
28 views
AngularJs: How to initialize the value for function Which is returning NaN?
I had a problem on my code in angularJs function which is return NaN instead of 0 during initialization.
Sample Code is Here
var app = angular.module('myApp', []);
app.controller('personCtrl', ...
0
votes
4answers
30 views
AngularJS, calculation addition (+) is not working
I tried to calculate $scope values through angular controller. For instance: the below code works in order to multiply values inside brackets. However, addition(+) is working like 400+200 = 400200. ...
0
votes
0answers
21 views
$scope variable doesnot bind with view after getting updated
I have a $scope variable isAuth that is a boolean which will be true when user signs in. And I use this variable to show a footer using ng-hide. I have a route definition with $routeProvider service ...
1
vote
0answers
18 views
function on $scope vs function on $window
We can create functions at scope level. If i have a controller todoCtrl then if i define a function inside the controller scope that method will reside inside the controller scope.
For example,
$...
0
votes
1answer
20 views
View No Longer Updating Immediately in Efforts to Clean Up Scope Soup
I've fallen victim to self-imposed $scope soup and am taking steps to correct this. I'm adopting some of the methods written about by Josh Carroll in his article here:
http://www.technofattie.com/2014/...
0
votes
1answer
18 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
33 views
Angular JS - NG-Repeat with filters and groupBy
I am building a dashboard to display ogoing and closed issues. I got everything working with angular's ng-repeat with filters and grouped by date. Here is a quick sample of what I got so far:
<div ...
0
votes
1answer
40 views
How to capture the error code in $q deferred promises
I have planned to create a custom alert message according to the error codes.
So I have to get the error codes while sending the request to the server and getting an response from the server.
500 - ...
0
votes
0answers
42 views
not getting textbox value using ng-click
I am getting an undefined when getting the value of the textbox which i weird because i have done this perfectly in my other controller. I am missing something or what
app.controller('expandCtrl', ...
0
votes
0answers
23 views
Update part of model from scope selected object
Ok, I have model with one property(provider) as object. It can change at all.
There is example, where I change provider. There can be any parametrs, image can has dpi, json can has another parametr.
...
0
votes
2answers
28 views
AngularJS function in controller and factory not working when separated
angular.module('myFirstApp')//
//begin controller
.controller('myController',function($scope,$http,personFactory){ //hi im controller i need to call the http service from the factory
//...
0
votes
0answers
12 views
Response for preflight has invalid HTTP status code 403- ionic app error
Hey getting error mentioned above. It is running fine on mobile but not on browser.preflight has invalid HTTP status code 403. Backend developer says he has coded everything perfectly at the backend. ...
2
votes
2answers
36 views
ngModel undefined when using directive - Angularjs controller
My ngModel is undefined when using the ngPattern directive. If I remove ngPattern, the ngModel works as expected. See plnkr.
Note how vm.condition does not show when typing a value in the text box, ...
0
votes
0answers
20 views
Cannot modify variable out of scope [duplicate]
No matter where I place the variable. The changes do not reflect outside the loop.
$scope.getSubsByEmail = function(email) {
var userNotFound = 0;
var arr = []
SITES.forEach(function(site)...
0
votes
0answers
21 views
Global Exception handling in angular js using promises : Exception handling: $q promises not catching Error code
I have plan to implemented the Err handling service globally for my existing application. I am not send the error code from server. so i have plan to implement the Error code in angular by using ...
0
votes
0answers
35 views
How to find a substring count with Javascript and then pass into AngularJS
Essentially what I want are numbers that I can pass into HTML based on a the number of times substring is matched from a response body.
I understand the best way to get that number is through regex. ...
0
votes
2answers
33 views
Implement a single method or use $scope.on and $scope.emit in AngularJs that will call the same method in multiple controllers without a service
I know similar questions has been asked in the past, but I hope to get a better understanding to my specific issue.
I have multiple controllers managing the view of a single page. The main reason ...
0
votes
0answers
12 views
angularjs datatable is not working while using datatable='ng' searching and pagination
My Controller
.controller('BankaccountViewController', function($scope, $uibModal, $log, $location, $routeParams, $timeout, DTOptionsBuilder, BankaccountService) {
$scope.dtOptions = ...
-2
votes
1answer
28 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
32 views
how to get multiple object value in angularjs
i have following code i have more then one object in return how to get these please help check below code and image file
.then(response => {
this.jobCategories = response.data;
...
1
vote
1answer
25 views
Project structure for large Angular application?
I am new to angular js
I want to create my project structure like this
- APPLICATION
-index.html
-app.js
-modules
-core
-controllers
-directive
-views
-core....
1
vote
1answer
32 views
Changing $scope.variable in $scope.$on function does not update view
I want to listen for route changes and update a $scope variable to reflect the current route in my menu (md-nav-bar):
$scope.$on('$routeChangeSuccess', function(event, current) {
$scope....
0
votes
1answer
42 views
Controller and directive variable's scopes
I'm new to AngularJS. I've started learning it from basics and began doing the simplest examples and the custom ones. Recently I've found some strange behavior of AngularJS.
I have the following code ...
0
votes
1answer
19 views
$http POST angular-Submit constant public key at the time of login
I need to submit public key with constant key value, along with username and password at the time of login.And also to redirect it some other page in ionic app- href="#/tab/abc", if login is ...
1
vote
1answer
33 views
angular js redirect to view
I have below code
code to render /result content whenever the defaultview function is called using the $route service
angular.module('myapp').controller
('ResultController',['$route',function (...
0
votes
2answers
34 views
How can i toggle directive without using scope declaration
I need to watch an attribute from a directive, and have that toggle a function whenever the value is true, this works the first time you click it, but i then need to reset the value of the ATTRIBUTE/...
1
vote
0answers
40 views
AngularJS ng-class doesn't update
I've got a problem with ng-class.
This is a piece of my controller
export class UIController
{
public static $inject = [];
public commands: Array<string> = ['showMap', 'showGantry', '...
0
votes
1answer
24 views
Work with ng-disable when required field is empty
I'm having some problems to put ng-disable to work, so, I have this div:
<div>
<p>{{ message }}</p>
<div >
<input type="number" id="field1" placeholder="field 1" ...
0
votes
1answer
33 views
Why does ng-show=“true” not reference $scope.true?
If I set $scope.true = false;, I would expect an Angular expression that references true to evaluate as false. Similarly, I'd expect $scope.false = true and $scope.undefined = true to yield similar ...
0
votes
2answers
49 views
How to add the values which is present inside the array (or) Json?
I been wondering if someone fixed my issue. my code looks like this.
var app = angular.module('myApp', []);
app.controller('myCtrl',function($scope){
//Adding New Check# and Check amount Text ...
1
vote
2answers
42 views
Why ng-repeate object not getting updated?
This is the function which load listings from server. Initially listings are displayed but when gets null response on applying filter, it still shows previous result and not clearing previous listings....
0
votes
3answers
29 views
View form surroundet with ng-if is clearing model
I'm trying to send some data from a form to my controller. Surrounded in the template file with an if. So my working example (without ng-if) is:
View
<form ng-submit="activate()">
<div ...
0
votes
1answer
32 views
User input not binding from $scope.$watch
Just getting started with Angular and I've spent the last 2 days trying to figure out how to bind data from a new search through a service. I had the search working before with the following code ...
-1
votes
1answer
32 views
Insert all data from front end to database using angularjs [closed]
Im very new to angularjs. I have some sort of data in in my html file. I need to insert all data from front end to database. Does anyone provide me some coding for that?
1
vote
2answers
35 views
IONIC APP- get device id for post service($http.post)
I'm trying to get the device id getUUID at the time of app login along with username and password. Is the right way to get device id and post it to the server for login.
controller.js
....
0
votes
0answers
18 views
init variable in ng-repeat's root scope
I want to know how can I initialize a variable in the ng-repeats root scope as I explained in the below block diagram. I should able to access the same variable in the filter that i am using as part.
...
0
votes
1answer
49 views
How to show data one page to other in angularjs
I need some help from you guys I am new in AngularJs, I have code there is too long code thats why I upload doc file, please check it below link, Using the code snippet below I'm authenticating ...
0
votes
0answers
9 views
Saving subdocument array via AngularjS
I'm struggling to figure out how to save a document array via AngularJS.
Here is the schema:
var itemSchema = new Schema({
name: {
type: String,
default: '',
required: 'Please fill in ...
0
votes
2answers
21 views
Passing value in function properly in AngularJS
I have the following function which takes variable description as parameter
$scope.relsingle = function(description) {
console.log(description);
var url = $scope.url+'/api/descrelation?limit=...
1
vote
2answers
34 views
AngularJS 1.5 - How to Set Two Way Bindings on Component
Directives in Angular 1.X are set to have two way binding by default. Components have isolated scopes by default. I have a view that looks like:
<div class="my-view">
{{controllerVariable}...
0
votes
1answer
13 views
How to call scope dynamically
I have in the View several models called dia1 dia2, etc.
I'm trying to invoke them from the controller dynamically in the following way
for(i=1; i<=7; i++){
Console.log($scope.day[i]);
}
It ...
0
votes
0answers
20 views
Can $scope.$eval be used when controller has an alias?
Currently running some tests to learn $scope.$eval, $parse, and $interpolation, but have encountered a head scratcher.
To conform to supposed best practices my demo controller uses the controller as ...
1
vote
2answers
38 views
0
votes
1answer
35 views
$scope.watch does not work between two different angular pages
the below code is working within one page with different controlloers, but scope.watch does not work when I pass value from one page to another. How can you do that? below is my code.
.factory('Data'...
-5
votes
1answer
43 views
How to iterate json file for login in angular JS controller?
[
{
"username": "admin12",
"password": "admin12"
},
{
"username":"admin123",
"password" : "admin123"
},
]
This is my json file.
1
vote
2answers
29 views
How to update the $scope variable values with the new Values I'm getting from the Database?
I have been setting the response values every time I hit the web-service to a $scope variable on click of a button but the $scope variable is not getting updated with the new values I have to Click ...
0
votes
0answers
55 views
Tr td ng-repeat angular
Using angularjs1.x My json is
[{
"headerid" : 1,
"datatype" : "label",
"fieldname" : "food",
"maxval" : 10,
"minval" : 20,
"parentid" : 0
}, {
"headerid" : 2,
"...
0
votes
1answer
15 views
Cannot modify scope properties using this
I have a controller dynamically loaded:
(function() {
"use strict";
APP.loadController("dynamicDemoController", dynamicDemoController);
dynamicDemoController.$inject = ["NgTableParams", "$...