In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.

learn more… | top users | synonyms

0
votes
1answer
14 views

How to use $emit and $on of angularjs for two different controller stored in different path

I have two views and its resp controller. Say view1.html and its controller firstCntrl and view2.html and its controller secndCntrl. In view1.html: There is two link which is will redirected to ...
0
votes
1answer
13 views

usage of ng-if and ng-switch inside ng-repeat fails

I am trying to compare userId with currentuserId and when the condition of action is approve i am trying to populate checkboxes. But my ng-if seems to be failing always. How can i do this better . ng-...
0
votes
0answers
7 views

dynamically Build ng-template using list

I am trying to build ng-template dynamically, In the Data structure, I have a Object that contains list of object of same type or other type of object. [ { ...
0
votes
2answers
21 views

unable to retrieve value inside the ng-repeat

I am trying to manually add values to the response that i got from the REST API and use it inside the View . The problem is i am not able to acess the manually added item inside the ng-repeat . Let me ...
1
vote
1answer
32 views

Ng-repeat to Jquery Cardslider

I'm having some trouble using ng-repeat into a cardSlider, I'm using an external data source, in which data is pulled out perfectly, I've used this on tables but on the process of binding it with the ...
0
votes
0answers
22 views

Angularjs array changes its syntax when it has only one record

I am using an angularjs array to store the record data(table rows) received by using the http.get rest API and printing using an ng-repeat. The problem is whenever there is only one record retrieved ...
1
vote
1answer
14 views

WYSIWYG shortcode to AngularJS function

I have a custom WordPress shortcode that when used in a WYSIWYG returns a bunch of html with an Angular function attached. Below is an example of what I am trying to do. Shortcode: add_shortcode('...
0
votes
1answer
25 views

cannot access directive's scope object in directive's controller

MaterialIn.directive.js angular.module('mdt') .directive('mdtMaterialins', materialInsDirective); function materialInsDirective() { return { restrict: 'E', scope: { ...
0
votes
0answers
10 views

not working Display blob (.pdf) in an angular app

i am done pdf download in my app. the pdf file is download successful but some error gets this: Failed to load PDF document here is my js code: $scope.downloadFile = function () { $...
0
votes
3answers
21 views

How to ng-if use when its value is “”?

How to use ng-if? I have below code. If image_path not null show td otherwise not. My code does not work. ng-if="hs.image_path != """ <td ng-if="hs.image_path != """><img id="...
0
votes
0answers
25 views

Write data from input to Firebase database

I wanna send data from input towards Firebase database using $scope. I don't know how can I send from $scope all data towards firebase database. Here is the html code : <div ng-app="angularjs-...
0
votes
0answers
32 views

Not able to use a two-binding in Directive in angularJS

I am using a controller like this app.controller('EmployeeCrtl', ['$http', '$scope', function($http, $scope) { $http.get('/Data/EmployeeDetails.json').success(function(data) { $scope....
-3
votes
0answers
34 views

Pass data (GET or POST) to angular 2 project

The angular project running on localhost:4200/auth /auth has code to receive post parameter. A another simple html file outside Angular project is sending post data to localhost:4200/auth. The ...
1
vote
2answers
32 views

How to refresh directive that existed in template and directive has own scope for data

I have - ng-view - template create item functionality and same template containing one directive that load the saved items. Now, when i do save create item and immediately, its not refreshing list of ...
1
vote
3answers
59 views

Angular JS Adding options to drop down menu on ng-click not working properly

I am pretty new to angularJS. I am trying to create an interface for the user where he will be able to select exactly two items from two drop down list. They are actually the same options. When the ...
0
votes
1answer
28 views

passing parameter to directive in Angularjs

I have the following directive: angular.module('SuperCtrl').directive('listDirective',function(){ return { restrict:'E', scope: { title:"=" }, templateUrl: '../templates/...
0
votes
0answers
14 views

Does it ever make sense to use $scope.$new(true,scope)?

An Angular $scope has the method $new(isolate, parent) where: isolate (boolean): If true, then the scope does not prototypically inherit from the parent scope. The scope is isolated, as it can not ...
0
votes
2answers
35 views

What method should be attached to $scope?

I am new to AngularJS, and have WPF MVVM experience before. Now, I'm very confused with $scope, it looks like it is a viewmodel, we can define functions on it and use ng-change, ng-click or some other ...
0
votes
0answers
17 views

View updating intermittently between page loads with an array change in angularjs

I have two components (contacts and notes) loading on the same page (from the main component) which both have simple http requests to add and delete information. They are only updating the view ...
0
votes
1answer
34 views

AngularJS - Update controller var on route change

I'm pretty much a newbie in the AngularJS world. This is my problem. I would like to update the selected tab based on the url, so that the selected tab changes when the url changes. This is my js: ...
1
vote
2answers
35 views

Why will always use anonymous function in AngularJS

I see almost tutorial use anonymous function in AngularJS, instead of normal function, like function name(para1) {}. Please see this link: http://www.w3schools.com/angular/tryit.asp?filename=...
1
vote
1answer
17 views

nested ng-repeat in angular js not showing anything

i am having this inside my controller method. var employee = [{name:"ankur",dept:"IT",company:"wipro",under:[{name1:"ashish"},{name1:"akash"},{name1:"tyagi"},{name1:"mogra"}]}]; $scope.employee = ...
2
votes
3answers
27 views

Simple controller make angular doesn't work

Hello I am learning angular 1 and I have problem at the very beggining. I'm trying to display data with table in ng-repeat using controller. Angular in app stops working at all even {{ 2 + 2 }} on ...
1
vote
0answers
24 views

how to perform three stage filtering of $scope in angularJS?

I would like to perform a 3 stage filter on my $scope, for example: So firstly user would choose a Course code which would narrow the results down, then the next select box (Occurrence) would ...
1
vote
2answers
58 views

Angular array doesnt show the data when it has one record

I am using an angularjs array to store the record data(table rows) received by using the http.get rest API and printing using an ng-repeat. The problem is whenever there is only one record retrieved ...
0
votes
0answers
69 views

Possibly unhandled rejection in a karma unit test

I use jasmine to write a unit test for a controller, where I have to check whether a function worked on $scope.$watch. I use 'controller as' syntax, but I've injected $scope to create a watcher. ...
0
votes
2answers
21 views

filting through 2 properties using custom filter angularjs

I am trying to filter through multiple properties in Angular. I am able to filter through one property easily by using an angular filter:{ title: searchString } but to filter through a multiple ...
0
votes
1answer
26 views

Passing div id to directive in angular

I have the following directive: .directive('addfields',function($compile){ return function(scope,element){ element.on("click",function(){ var enviroElement = angular.element('<enviro-...
0
votes
1answer
24 views

Modify variable of parent controller inside child controller AngularJS 1.x

I have my body controlled by a MainController. In the body, I have another nested controller. In my index.html, I have a div element controlled by the nested controller: index.html <body ng-...
0
votes
0answers
31 views

how to attach excel file on send email in angular js

i am used angular js for creating excel file but now i include also that file in my email from how to that possible. my js code: $scope.email = function () { var blob = new Blob([...
1
vote
1answer
18 views

Angular 1.X - Accessing controller variable through directive using $watch

Within a controller I have an ajax call that populates $scope.main_data. I want to within a directive get that data when it populates. However the two issues I'm having is: I cannot seem to access $...
1
vote
1answer
38 views

Change in ng-model value getting changed in the other Parts of the list also

I have a view which i am displaying to the user it is a Result list and i'm displaying it on the screen. From view user will be able to click on hyperlink that will allow him to modify that particular ...
0
votes
1answer
22 views

Filter through multiple properties in AngularJS

I am trying to filter through multiple properties in Angular. I am able to filter through one property easily by using filter:{ title: searchString } but when I try to use multiple properties... it ...
1
vote
3answers
39 views

How to show a title from an array in each state with ionic?

I'm trying to make a playlist app with ionic, and I would like to show on each state by id the title (this is a starter app from ionic sidemenu template, without many changes from the beginning), here ...
0
votes
1answer
26 views

inserting a directive every time a button is clicked

I am working from a tutorial here: https://fourtonfish.com/blog/2014-01-dynamically-add-directives-in-angularjs-no-jquery/ However, I want to create a directive and inject this into my HTML every ...
0
votes
0answers
19 views

angularjs ng-repeat autonumber increment from multiple arrays

I have this ng-repeat: <div ng-repeat="prop in props"> <div ng-repeat="tenant in prop.Tenants"> <label class="col-md-6 control-label">Tenant {{$index?}} ({{tenant....
0
votes
1answer
37 views

Value of ng-model getting changed when we change value for particular record

I am populating my response from REST API using AngularJS on the front end by using ng-repeat . I'm Providing user with an option to modify each result that is displayed on the screen . When the User ...
1
vote
2answers
38 views

AngularJS - directive scope model doesn't update without debugger

For create/edit a website content I have a form with some tabs (buttons making the idea of tabs system because the user may want to add another "tab", etc, etc) and I use a directive to show the ...
0
votes
1answer
30 views

variable is not acting independently when using multiple copies of same angular directive

I'm trying to create a directive with 2 radio button binding with update variable. Now I planned to use the same directive in once again. Now the problem is the scoped variable update is not acting ...
0
votes
1answer
23 views

Reader.onload upload image file to blob angularjs

I'm in this problem a days. What happens is the following when I try to click the update image button I can not do the image update on the first try despite my console.log it return me the correct ...
2
votes
2answers
57 views

angularjs - select's ng-model index

I am trying to get all the selected item(s), e.g its value or title, in a select control. Basically, after user has selected the item(s) he/she wants from the select control, I want to get the number ...
1
vote
2answers
36 views

AngularJS - TypeError: v2.[xxxx] is not a function

I am trying to conditionally set the background position of a div element based on their array index using ng-style. Each div is being generated using ng repeat. In my html page, I have the following ...
0
votes
0answers
23 views

Get instance of kendo ui chart widget in controller

I have a requirement to create multiple keno line charts in a screen. Below is the HTML markup <div ng-repeat="agent in chartAgents"> <div kendo-stock-chart="sales_{{$index}}" k-...
0
votes
0answers
55 views

angularjs $http.get nothing show

hi guys it's my first time i use AngularJS. here is my AngularJS code: var app = angular.module('apps', []); app.controller('foodsCtrl', function($scope, $http) { var url = 'http://localhost/...
0
votes
3answers
38 views

Not Able to access ng-model value in controller

I am having a code in which I am trying to access the ng-model values inside the angular controller but getting undefined everytime I am trying to call the ng-model value. Code var app = angular....
4
votes
1answer
29 views

how to set scope in template?

Hi I append created element to parent: container.append(UIService.appendWorkItem(workItem)); UIService function appendWorkItem(item) { return '<div layout="column" ng-init=item='+...
2
votes
1answer
28 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 ...
1
vote
1answer
27 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
34 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
33 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 ...