In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
1
vote
2answers
27 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
38 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
20 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
32 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
27 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
24 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
31 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
31 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
48 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
41 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 [on hold]
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", "$...
1
vote
1answer
30 views
Ionic app does not print $scope
I have an ionic app which uses angularjs. Inside the angular controller I am not able to print $scope with console.log($scope). However I am able to access variables likes $scope.var.
angular.module('...
1
vote
1answer
27 views
AngularJS, how do you get a `select` to refresh automatically?
I have a problem with 'select' when I choose an option in 1st 'select' I don't see the result in same time in the 2nd 'select', I must refresh the page manually with 'F5' so I can see the results.
...
0
votes
4answers
53 views
ng-click directive not calling controller function
I am working on an ionic app, trying to use ng-click to call a function from my controller. here is the function i want to call.
function startSpin()
{
if ($scope.wheelSpinning == false)
...
0
votes
3answers
36 views
Angularjs - How to submit a form from different controller?
<div ng-controller="ctrl1">
<form name="form1" ng-submit="submitForm()">
<input type="text" name="email" />
</form>
</div>
<div ng-controller="ctrl2"&...
0
votes
1answer
46 views
Angularjs: View is not updating when scope in controller changes
View is not updating when my scope in controller is changing. I am actually trying to use a timer in my html. When timer is counting down, it is not updating in the view.
here is my view:
<div ...
-2
votes
1answer
13 views
unable to carry form field data to next html page using angular js
Hello all i am trying to carry one of the field value from one html page to another using angular js. Below are the code snippets
HTML:
<body ng-app="myApp">
<div ng-controller="...
0
votes
1answer
22 views
Ionic- display picture taken with camera on same page
I'm trying to display image captured through camera on the same page without visiting phone's memory. Somewhat like watsapp, the way we click and upload right away from there only. So, it is like we ...
0
votes
1answer
23 views
IONIC App-Horizontal, scrollable thumbnail slider
there is a list of orders. When we click on >(right chevron detail option), it redirects me to order detail page. Order detail page may have a list of items ordered by one person. Each item has camera ...