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

-1
votes
2answers
26 views

angularjs pass index thoruhg directive

i need help with this code. <ul ng-init="round = 'round'"> <li ng-repeat="mesa in mesas" ng-click="selected($index)"> <div id="{{round}}">&nbsp;</div> MESA {{...
0
votes
3answers
31 views

how to get text area empty automatically when user click anywhere on the page. Angularjs, Javascript?

I'm working in angularjs project, I have one text area which gives me some result on search.I want my text area to be cleared whenever i click anywhere on the page.My code is <input type="text" ng-...
1
vote
2answers
28 views

dynamic ng-model using multiple dropdown and ng-reapeat

Hello every one i have a language multiple selection input. On select language i need to open textboxes of selected language with dynamic ng-model. this is my json and code. [{"id":"1","lang":"...
0
votes
0answers
16 views

angularFileUpload don't fire event

i am trying to do a file upload with angularFileUpload module, so in my view i have something like this: Upload image <input type="file" data-ng-file-select="onFileSelect($files)" accept="...
0
votes
1answer
30 views

Can a $rootScope variable be passed in state file - AngularJS

I'm working on an Angular project and currently am working on making the entire project configurable. I have an object which contains an array of elements, each element being an object with the ...
2
votes
0answers
28 views

Update element created by directive on change of controller varibale

I am trying to create an angular app where user can create a dynamic form. In this user can create form fields and save form metadata, which is then used to display actual form. There is live preview, ...
-1
votes
1answer
17 views

How to update the directive when the parent's scope variable changes?

Directive: <div ng-show="{{ show }}"> ... </div> angular.module('mymodule').directive('mydirective', [ function () { return { scope: { show: '=' }...
4
votes
2answers
31 views

Angular JS passes App ID and Key with every request

I have a basic angular APP that makes a GET request call to a API URL. The data returned is in JSON format. The API documentation states the following: You must provide your App ID and key with ...
1
vote
1answer
49 views

Differnce between $scope.Variable and $scope.Function in Angular?

$scope.some_random_variable = "random_value"; $scope.some_random_function = function(random_param){ console.log("randomness"); } I want to know the difference in the context of digest cycle. As ...
0
votes
1answer
19 views

Angularjs Class Confirm button

I am trying to create a "confirm" button for users of my website to see when they click on a button, and I am using an angularJS class. My code is as follows: class TodosListCtrl { constructor($...
0
votes
1answer
44 views

Why is $scope not working in Angular 1.6.1?

Background After following the AngularJS tutorial on codeSchool and reading some StackOverflow questions, I decided to start using $scope in order to avoid the hassle of having to define a var self = ...
1
vote
1answer
51 views

angular 1.6.1 '&' binding issues

Problem: When I bind '&' under ng-repeat(or without for that matter atm), I can't seem to trigger the parent scope's function. HTML <div ng-repeat="type in fC.types"> <repeater type="...
0
votes
0answers
14 views

Injecting $location service makes my url with fragment identifier weird

Here is my angular code var app = angular.module('app', []); app.controller('mainController', ['$location', '$scope', '$log', function(location, scope, log) { log.info(location.path()); }]); And ...
1
vote
3answers
51 views

AngularJs ng-repeat custom structure

I have a dataset like this $scope.dataset= [ {"Name":"Alfreds Futterkiste","City":"Berlin","Country":"Germany"}, {"Name":"Ana Trujillo","City":"México D.F.","Country":"Mexico"}, {"Name"...
1
vote
1answer
22 views

Adding Form Fields Dynamically in angularjs not working

I am developing an online course application. I am trying to add form fields dynamically in my application, so that I can add more video lecture for a course. However, when I click on "Add Another URL"...
2
votes
1answer
35 views

can't pass dynamic parameter to angular directive

I just took over the frontend work of our angularjs apps and I'm stuck. I've been creating directives to replace bloated html to make updating the frontend look easier. All was going well till I hit ...
0
votes
1answer
21 views

Passing Controller's $scope variable to nested directive's controller

I'm having trouble passing a scope object from one controller to a nested directive's controller. I have a directive (child) within another directive (parent), the parent directive and its controller ...
0
votes
2answers
21 views

Add/Remove class if checkbox is checked/unchecked (AngularJS)

I need to toggle a class if a checkbox is checked/unchecked with AngularJS. My Code is working on Plunker but in my controller there is no functionality. Here is the Plunker: Click! My Controller ...
0
votes
1answer
27 views

Angularjs - How to set value of Global variable according to one of the response data element

I want to set the value of glovalvar according to defined in function hello I am getting response data & according to that I want to set globalvar Value. Here is snippet: var app = angular....
0
votes
2answers
30 views

How to preserve scope in componentized Angular app containing a dialog that serves a custom directive

I have a question about how to pass scope to a template rendered from a directive. This seems like it should be so straight forward but somehow I am having a lot of trouble getting it to work. My ...
-1
votes
2answers
62 views

Convert text input to lowercase - Javascript

Having trouble creating a case insensitive search in my Ionic app. I have the following that pushes tags into firebase. How can I convert the entire array to lowercase before going into the database?...
0
votes
3answers
47 views

How to iterate through angular $scope variables with a for loop

I want to iterate through an array using for loop instead of using foreach in which i m not able to break the loop. But here in for loop i getting $scope.items[i] as undefined! here i m dynamically ...
0
votes
1answer
25 views

AnularJS anonymous component replace inner scope

Hi I am using Angular with ES6, now I want to get rid of the $scope since Angular2 will not use it anymore and I want to create futureprove code,... this works: let tab = this.tabManager.getArea.open(...
0
votes
0answers
74 views

$compile directive not hiding elements in ng-repeat

After upgrading from Angular 1.3.2 to 1.5.11 it appears my custom restrict directive is no longer working as expected. The directive is responsible for hiding elements through comparing a user's roles ...
1
vote
1answer
21 views

Directives scopes and inheritance

Could someone explain to me, why with the following code: <html ng-app="myApp"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script> <...
0
votes
3answers
30 views

Angular directive not picking up the values set by parent

I have a directive that has a div, whose visibility is set by its parent. Expecting "show" to be true, but the div is still not visible initially on page load. Directive: <div ng-show="{{ show }}"...
1
vote
0answers
42 views

Using Resolve In AngularJS Routes to get Json data

I'm trying to get Json data in AngularJS Routes and then inject it to the controller. A resolve contains one or more promises that must resolve successfully before the route will change. This means ...
0
votes
1answer
14 views

Error: [$compile:multidir] when using multiple directives on same element

I made a form for credit cards payment which contain many validations, on the input below I try to validate 2 settings, one is the card type (visa,diners,amex, etc...) and the second validate is for ...
-1
votes
1answer
35 views

How to trigger the function after DOM markup is loaded in angular style application except onload

I need to show a Simple current time with an angular based-application.So have tried a demo. In the body onload function execute the piece of function. <body onload="startTime()"> function ...
-1
votes
0answers
43 views

Angular constructor function possible memory leak

In our app we use constructor functions intensively, but whenever we are initializing a scope object with new and constructor function it is placed on the Heap (Open Profiles in chrome dev tools and ...
6
votes
1answer
108 views
+50

Angular JS : Uncaught DOMException: Failed to execute 'removeChild' on 'Node' on HTMLScriptElement.callback

I am using Angular JSON Http call. in the same When I make the post request like this : app.service('AjaxService', [ '$http','$q','$sce', function($http,$q,$sce) { return { ...
0
votes
2answers
51 views

Using $location.url() inside a directive not working in angularjs

I have a directive and inside it, I used the $location.url() but it seems not working, and I think I need to inject something on my app but I don't know where to inject it. By the way I'm new to ...
1
vote
1answer
45 views

angularjs country code look up from jsonfile via $http request

I am trying to look up country codes from a json file to get the full country names: $scope.fullname = function (option) { $http.get('files/names.json').success(function (data) { for ...
0
votes
1answer
38 views

How to create a modal using angular components?

I'm pretty new to angular, and I'm trying to create a modal as a component (trying not to use ui-bootstrap or libraries) and I'm having trouble wrapping my head around it. My code: App.component('...
1
vote
1answer
30 views

google map does not show properly

how to call initmap method in angularjs because. map does not show... properly when i use $scope.mymap = function(){} when i clicked refresh button its working fine, but when i change the tap, and ...
-1
votes
1answer
38 views

Angular JS live select dropdown search filter

I am grabbing some news items from a newsfeed REST API and have implemented a free text instant search. I am now trying to implement a search from a dropdown list that works with the same data but I ...
2
votes
2answers
46 views

“$parent” in multi-level directives

I am trying to understand a working code. It can build a very simple json data by adding name:value pairs one by one with GUI; by a custom directive and its link function, it builds a html template as ...
1
vote
0answers
31 views

Can a directive inherit a ng-click from his parent scope?

I am trying to work with ng-view directive and I want to batter understand the parameters of my scope and controller. my web page has a static part and inside of it the ng-view directive like so: &...
0
votes
2answers
33 views

When does ng-class ends expression evaluation and applies the class?

I'm trying to reach something similar to a FullScreen-mode feature: using a button to trigger the fullscreen mode, then another button to return. The subject: <div ng-class="{full: !...
1
vote
0answers
36 views

Angular service to share data - Is this the correct approach?

Hello Angular Gurus, I'm using a service to share data between two controllers. I'm sharing data between BankController and CreateBankController. What I observe is that the CreateBankController ...
0
votes
3answers
39 views

rootScope variables are null after time

i'm developing an app with ionic that should save some variables like rootScope variables at the login and reuse these variables in http requests during the run of the application. My problem is that ...
0
votes
4answers
56 views

AngularJs Custom Directive scope data overwritten

I have displayed the products based on branch and billing account. In the product template, i have a "+" button, if we click on the button, then i'm displaying the particular product id below that ...
0
votes
1answer
25 views

Angular 1.5 directive with one-way binding updates parent scope

I have a directive with an isolated-scope and one-way binding variable. yet when i change that variable in the directive controller it updates the parent scope as well. Example code: function ...
0
votes
0answers
40 views

Angular two forms, two ng-click, same function, only the first one runs

I have two forms on a page. The first adds an item to the database, and the second is prepopulated with the data and allows the user to modify the item. The first form allows the user to create and ...
1
vote
2answers
54 views

$scope variable do not respond to the onClick function of angular chart

I have a chart in the page. When one click in the chart, the onClick function will be called and it will know which category of the chart has been clicked by user. I created a div to show $scope....
0
votes
3answers
27 views

Angular JS : Error while getting data from typeahead

I am getting error while loading the module for angular JS in my Module, UI bootstrap here is not getting loaded despite of all the dependencies resolved. can any one help me ? Fiddle Link https:/...
0
votes
1answer
16 views

Angular $destroy method not called on page navigation in Rails app

I have an application that uses both Angular and Ruby on Rails. Some of my Angular controllers create $interval timers that need to be cancelled when the user navigates to a new page. This Stack ...
0
votes
2answers
42 views

AngularJS - Factory variable doesn't update in controller

I'm facing a new issue with AngularJS. Infact, since I need to have a "shared" variable, readable and updatable in 2 controllers, I thought about doing that with a factory injected in both the ...
0
votes
3answers
39 views

Access the main controller's scope from inside a directive

Suppose the following blueprint code: <div ng-controller="myCtrl"> <div ng-repeat="..."> <div ng-repeat="..."> <div ng-repeat="..."> &...
0
votes
1answer
27 views

how to use google map in angularjs with script of key Without Google SDK

i don't want Google SDK, i have following code..i but its show error when i use tag its working fine but i am using angularjs its show error , normal page with script in page its working fine..how ...