In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
4answers
32 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
33 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
41 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 $...
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
33 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.
<...
1
vote
0answers
25 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
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 ...
0
votes
1answer
34 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
29 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() {
...
277
votes
8answers
315k views
AngularJS access parent scope from child controller
I've set up my controllers using data-ng-controller="xyzController as vm"
I have a scenario with parent / child nested controllers. I have no problem accessing parent properties in the nested html by ...
37
votes
1answer
15k views
Should angular $watch be removed when scope destroyed?
Currently working on a project where we found huge memory leaks when not clearing broadcast subscriptions off destroyed scopes. The following code has fixed this:
var onFooEventBroadcast = $rootScope....
-1
votes
5answers
26 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">
...
1
vote
1answer
23 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
19 views
How to sort datetime ng-repeat in Angularjs?
I want to 27 December top 26 , 25 ...sort created_datetime. How to do this?
<tbody class="gradeX" ng-repeat="x in Profile | orderBy: x.created_datetime">
...
0
votes
1answer
15 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 ...
0
votes
1answer
298 views
how to display html content, which is retrieved from the server using angularJS?
Actually I have an html file in the server that, contains img tags, javascript and css codes, what i'm trying to do is to get the content of this file using $http service and display it inside a twig ...
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
46 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.
...
9
votes
2answers
20k views
how to set dynamically height to element?
I am trying to set dynamically height to element in my demo .I will tell you issue I am taking static or constant value of height in my demo .I take 250px constant value
#wrapper{
background-...
2
votes
4answers
46 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
1answer
43 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
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 ...
27
votes
6answers
26k views
Anyway to trigger a method when Angular is done adding scope updates to the DOM?
I am looking for a way to execute code when after I add changes to a $scope variable, in this case $scope.results. I need to do this in order to call some legacy code that requires the items to be in ...
0
votes
1answer
34 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....
-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 ...
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 ...
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 ...
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
23 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 ...
4
votes
1answer
25k views
Angular Search for value in JSON and display corresponding data
What i am trying to do is simple. A user enters a value, on button click, my JS calls a service to retreive my JSON data and perform a search on the value entered against the JSON and if a match is ...
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
35 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....
0
votes
1answer
53 views
Angularjs: open on focus and month picker feature to calendar?
How can I add open on focus feature(similar as Microsoft windows 7 calendar) to my calendar as given in demo where we using angular materiel version1.0.1, please help me with solution.
Thanks In ...
-3
votes
2answers
25 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%...
-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
0answers
115 views
Angular Directive Transclusion Scope Issue
I am creating a custom directive as follows:
<directive-a attribute-a="customData" attribute-b="customKey">
<!--Transcluded Content-->
</directive-a>
The scenario is as follows:
...
1
vote
1answer
4k views
Angularjs share functions inside service
I am working with an angular app, where service are as declared as follows:
App.service("myService", function(){
this.calculation1 = function(){
var util = function(){
}
//doing ...
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
1answer
63 views
How to implement 'Open on focus' and 'monthpicker' to Angularjs calendar?
I am new to Angularjs, how can I add open on focus implementation (similar as Microsoft Windows 7 calendar) to my calendar as given below where we using Angular material version1.0.1. We decided not ...
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
3
votes
1answer
296 views
ng-show and ng-if lags to hide content
I have the following in to show and hide the clear button based upon if the searchQuery is empty or not. When a user starts typing in the input box, the button shows instantly.
However, when the ...
242
votes
7answers
110k views
$watch an object
I want to watch for changes in a dictionary, but for some reason watch callback is not called.
Here is a controller that I use:
function MyController($scope) {
$scope.form = {
name: 'my ...
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
2answers
73 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, $...
3
votes
2answers
7k views
The submit button not working AngularJS
So basically wwhat I'm trying to do is take input of two numbers n1 and n2 and then print their sum all using angular. I have used bootstrap for styling. But i noticed nothing was happening so to ...
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
31 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 ...