In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
1
vote
1answer
17 views
How to pass data from function to angular controller scope
I stuck at this problem for days.
I use angular file upload to upload image.
I can upload the image to the server, and I can get the response image url from the server back.
But I can't get the ...
2
votes
1answer
16 views
Accessing $state outside angularjs
I have an angularjs application. The app is supposed to be a hybrid mobile app for android and iOS. I have a JavaScript file in the project which is not a part of any module. In that JavaScript file I ...
1
vote
1answer
32 views
How to add item cost in Angularjs?
I want to add work item cost but its show original value.
Example:
item[1].cost =2 ,item[2].cost = 2 ..
When I add 3rd item[3].cost = 8 it's Total = 228. I want add SUM, how to do this? I want ...
0
votes
2answers
26 views
Access to controller scope from $scope.$on in AngularJS
I'm beginner at Angular and I have this simple problem in Angular 1.5. I use rootScope for emit some events and $scope.$on as the event listener in component controller (which provide data for child ...
0
votes
1answer
20 views
ng-enter not working when I use controller as syntax
I am trying to use ngEnter directive in my angular app
app.directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
...
-1
votes
1answer
38 views
How to modify angular $http.get().then response invalid JSON to valid JSON
We need to implement type ahead functionality in inbox box ,but when we got response from $http get is invalid JSON so that i cant able do that.
below method i am using for view level
uib-typeahead=...
0
votes
0answers
29 views
can we assign value of an element to ngmodel using pure javascript
this is my sample javascript and angular code
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.set="somevalue";
}
//javascript code
function addValueUsingJavascript() {
var ...
0
votes
2answers
18 views
Edit the selected option text in “ng-options” select-list
I need to add the text "(Default)" to the selected-option text. please help me...
The text should be "Visa 1881 (Default)".
But its only showing "Visa 1881". Here is my code:
<select ng-...
0
votes
5answers
50 views
ng-hide is not working
I am new to angularjs.
When I click on "Click Me" the toggle method is called. The value of test changes from false to true, but ng-hide is not acknowledging the new value of test.
<div ng-app="...
0
votes
1answer
32 views
How do I separate the json objects in a get http request in a $scope?
[{
"entityList": [
{
"scenarioNo": "SC1",
"accountingMonExtracted": null,
"acronym": null,
"address1": "542 W 27th Street 4th Floor",
"address2": null,
"...
0
votes
2answers
34 views
Toggle two classes with AngularJS / jqLite on click
I wan't to get a slideIn / slideOut animation by toggling the classes slideInRight and slideOutRight to a ul element.
I've tried it in different ways but I it only works with one className.
How ...
1
vote
0answers
27 views
AngularJS 1.5 component get parent ngModel
I can't change ngModel defined in $ctrl. It looks like this:
1. I have next code, defining component in index.html:
<div ng-controller="appControllerData">
...
<div ng-controller="...
0
votes
1answer
38 views
reload the angularjs after update , date not updated
i am working in angularjs 1.i am trying to make CRUD in angularjs and laravel.i have successfully make the CRUD and CRUD is working fine , in my application their is child and parent routing present ...
0
votes
1answer
37 views
Duplicates in a repeater are not allowed?Use 'track by' expression to specify unique keys.?
I have created notification service globally for the application, while sending the db call, capturing the error code in interceptors and show alert.
how to avoid the duplicated Error mesage in ...
0
votes
3answers
24 views
AngularJS 1.x update nested property
I have problem with modification of nested property. How to watch these nested properties in task.history array? Or how to modify the $scope.$watch?
Here's plunker. Click keyboard_arrow_up icon.
http:...
1
vote
4answers
31 views
why the factory is not able to access inside the controller
I have created notification factory and pass inside controller,Inside controller when assign the factory to the scope getting error.
alertsManager
MyApp.factory('alertsManager', function() {
...
0
votes
0answers
10 views
Notification alert service not working in controller getting typeError: Cannot read property 'alerts' of undefined
I have capturing the application response error ,while capturing the error, i am getting the error.
In Interceptor ,according to the response code , have assign the rootscope broadcast and show the ...
1
vote
1answer
24 views
Access a child state from a child state
I want to access a child state from a child state but I get : angular.js:14195 Error: Could not resolve '#/projects/detailProject' from state 'projects.list
these are the states :
function ...
0
votes
2answers
38 views
How to get id in dropdown and also set default value on top
I have the code below and I want card_id but it shows null. How can I get the id and is_default card on top? when I use ng-click, it shows the result below. I want to get the selected card_id.
<...
0
votes
2answers
23 views
How to sort by descending datetime ng-repeat in Angularjs?
I want to sort my data by descending date, ie 27, 26 , 25 .... How to do this?
<tbody class="gradeX" ng-repeat="x in Profile | orderBy: x.created_datetime">
<tr>
<td>{{x....
-1
votes
5answers
31 views
how to show default dropdown value show top angularjs
I have a dropdown show below card information and i want to show is_default= true card show top other cards below.. please help me
<select ng-model="approvedinvoicesCtrl.currentcard.card_id">
...
0
votes
3answers
44 views
Convert Object to Array angularjs with dynamic value
{"13":"I","14":"E","15":"V","16":"G"}
to:
['I', 'E', 'V', 'G']
where the 0 property of objects have the array of 1 and 2 objects? Is there a way to do that?
<div ng-repeat="data in data" >
&...
3
votes
4answers
47 views
Read AngularJS expressions in a script outside the controller function
Because of the following quote in this thread
The best practice is never use JQuery or angular.element() for DOM manipulation inside controllers. Controllers are only used for our business logic.
...
0
votes
1answer
47 views
Angularjs Data Binding among Controller, Directive, and Service
I am trying to update content of a directive with the data coming from a service. It works like this:
Service (html5 canvas service) -> calls a method in controller on some action
Controller updates $...
2
votes
4answers
47 views
Angular - loop over nested javascript arrays
How can I use ng-repeat to loop over data that contains many nested array data?
I have data that will have many "Segments"
Example:
confirm.booking.flightData[0].Segments[0].FlightNumber
...
0
votes
0answers
16 views
download Excel with filtering in Angular JS
I would like to implement exactly excel-like filtering such as
If there are 2 columns, one of name and other would be of age.
Now when no filter is applied, filters are showing all data.
When we ...
0
votes
1answer
38 views
how to pass value from dropdown ng-change event
i want car_id how to get car_id from dropdown and pass to ng-change event please help me
<select ng-change="carsCtrl.ok(car_id)">
<option ng-repeat="item in carsCtrl.current_job....
2
votes
1answer
30 views
How can I use one service to update both the parent and child scope in AngularJS?
I am trying to implement services more in my code and would like to use only one service that updates data in both ParentCtrl and ChildCtrl at the same time.
I have read that services are singletons ...
-1
votes
1answer
31 views
access resolve in component controller in angularjs 1.5
I am trying to bind to an angularjs 1.5 component a resolve value without success, In the state definition, I have replaced the common value of template properties with a value of the name of my new ...
0
votes
1answer
38 views
How to change $scope for this because with controller doesn't work
Good morning, I'm trying to use this treeview for Angular: https://github.com/eu81273/angular.treeview
This is the .js file that I use in my HTML that I need to change the $scope for 'this':
(...
0
votes
1answer
45 views
Angular.js - ngModel value is undefined when ng-pattern is set in directive
something similar may have been answered (ng-pattern + ng-change) but all responses were unable to fix this issue.
I have two imbricated directives for creating a form input, a parent directive to ...
0
votes
1answer
26 views
Sub Scope Not Updated In Group by ng-repeat Checkboxes
I Have Ng-repeat CheckBoxes List In My AngularJs Application
"(key, value) in MyScopeModel| groupBy: 'Filed'"
Every Check Box List Has One Check Box To Select This Group All Or UnSelect
The Problem ...
0
votes
1answer
20 views
bind or print from directive
I am accessing my selected file using a directive as suggested by some SO answers,and i am able to console my file name in the directive.Now i want to bind that name to html from that directive........
0
votes
1answer
38 views
How to properly bind object in 'bindings' using $compile in angular.js 1?
I want to dynamically compile component for inserting this to specific DOM element (DOM also dynamically created by 3rd party library).
So, I use $compile, $scope.
https://jsbin.com/gutekat/edit?...
0
votes
2answers
38 views
Why does it work with $scope but not with `this`?
I want to know why the following only works with the scripts 1 and 3 and not with the 2. I want to use this because in my project I can't use $scope.
Thank you!!
<script src="https://ajax....
-3
votes
0answers
17 views
how to sum ng-repeat sum values and add in total
how to sum item.cost show in total when i change 2 + 2 its how old value 19 not 4
<tr ng-repeat="item in submittedinvoicesCtrl.current_job.invoice.work_items">
<td><input type="...
0
votes
3answers
38 views
how to call method inside $http body angularjs
I want to call editopenComponentModal in my other method its show error angular.js:13920 TypeError: Cannot read property 'editopenComponentModal' of undefined
EditCurrentJob(job) {
this....
0
votes
2answers
23 views
Angular: referencing my data in the controller
I am not sure how I pulled this off but I've got an object displaying all my data in the view, but no reference to it in the controller.
I assumed my data was in $scope or in this, but not that I can ...
-3
votes
2answers
26 views
AngularJS Error: $injector:unpr Unknown Provider. edited
Now i have added code in the question.
controllers.js
services.js
and getting this error.
angular.js:13642 Error: [$injector:unpr] http://errors.angularjs.org/1.5.6/$injector/unpr?p0=%24scopeProvider%...
0
votes
0answers
16 views
How can i back-port angularjs directive features from latest version?
I am new to Angularjs, how can I back-port 'md-datepicker' directives features of angular material version1.1.1/css to angular materail version1.0.1-rc2/css, please suggest easy way to do it. Thanks
0
votes
0answers
18 views
AngularJS 1: testing promise resolution to component scope
I am relatively new to angular testing and I am trying to test a simple component which, after getting json data through a $http call, updates the $scope on promise resolution:
app.component('...
0
votes
0answers
47 views
angularjs Scope is losing value?
I have a form that intakes an address along with some other data. I would like to send the address through google geocode for lat and long. then pass all the data into my db. So I can perform all the ...
1
vote
1answer
28 views
Angularjs Promise.all not updating scope, while $q.all does
I am using Angularjs 1.3.7 and just discovered that Promise.all does not update angularjs view after a successful response, while $q.all does. Is this later changed since Promises are included in ...
1
vote
2answers
77 views
ng-click function not able to call service
I'm retrieving data from the web-api on click of a button but when i execute this code i get error 405.
var app = angular.module("angularApp");
app.controller("loginController", function ($scope, $...
0
votes
0answers
31 views
Angular Getting access to variable via this?
I have my state example with the js:
app.config(function ($stateProvider) {
$stateProvider
.state('example', {
url: '/example',
templateUrl: example.index,
...
0
votes
2answers
32 views
AngularJs - ng-options object.object
I am displaying countries and cities in a select box in angularjs, which are working fine. ng-model of country displays the output when I call {{country}}. However ng-model of city couldn't be called ...
0
votes
1answer
79 views
Global variable is not updating in angularjs
I'm trying to fetch an user input from HTML I'm trying to update the getPlace variable to whatever user inputs which is stored in this.findPlace , it works perfectly if I do console.log(this.findPlace)...
0
votes
2answers
22 views
how to validation credit card in angularjs
how to validate credit card number... less then 16, month 1 to 12, ?? please help angularjs
see below code and image
<td><input type="number" class="form-control" id="inputDefault" ng-...
0
votes
3answers
24 views
Scope true in directive giving wrong result
I am using scope as 'true' in a directive. So now, this directive scope passes from parent to child, but not in reverse. I am printing now scope.name 2 times. First in parent scope, second in ...
0
votes
1answer
18 views
Angular: Access variables from outside scope of ng-repeat
I am having issues accessing variables (attached to $scope) inside ng-repeat loop. My ng-repeat is as follows:
<div class="row" ng-repeat="Message in Messages">
<p>{{ Message.Sender ...