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
11 views

How to get ng-model value in controller using angularjs?

How to get ng-model value in controller using angularjs I here I got player name alert when submitPlayer clicked but i want that corresponding player id how it will get this is my html code ...
1
vote
2answers
18 views

Load css from a CDN in an Angular 2 Component

As the title says, i want to include external css in an Angular 2 component. Here's how i am doing it now: import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-auth', ...
0
votes
0answers
17 views

Recycle a scope in angular

I'm trying to reuse a scope in my file to use Materialize CSS modal. I can output the data, but I cant reuse it on my modal. Here is my code: <!DOCTYPE html> <html ng-app="posApp"> <...
0
votes
2answers
18 views

How to invoke custom filter manually?

<div "ng-repeat="phone in phoneList| filter:filterPrice"> //custome filter $scope.filterPrice = function (phone) { return (phone.price > MIN_VAL && phone.price < ...
0
votes
0answers
12 views

Multiple Datalist Inside a dynamic table in Angularjs

Hi All, I am integrating REST Services with Angular JS so I am getting the records and displaying in dynamic table by ng-repeat. Rows are expandable and collapsable. When we expand a row we have a ...
0
votes
2answers
42 views

Making Monthly attendance Report Using AngularJs

I have employee records which needs to show in the table <link data-require="[email protected]" data-semver="3.3.6" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/...
0
votes
0answers
19 views

AngularJS data-binding doesn't work when input updated by third-party libraries

The form is using jquery.placepicker to get addresses from a google map and ng-bs3-datepicker to set the date. I found that the data isn't updated in the controller's scope. How can I trigger the ...
1
vote
4answers
45 views

Angular: Using “this” instead of “ $scope” in “Controller As”

I want to use "this" instead of $scope because I have a controller structure that doesn't initialize $scope: .controller('MyCtrl', function($scope) { ... }); I must follow a tutorial with the ...
0
votes
0answers
18 views

Bootstrap select picker with ng-repeat is not working for JSON object

I was using Bootstrap select for search and multiple select but the problem is when i am using $scope object in ng-repeat for options it's not working . I have given my codes below . <select name="...
0
votes
3answers
22 views

AngularJS: How to bind ng-model to an 2 dimensional array

I am newbie in AngularJs. I would like to create multidimensional array element in ng-model as defined below. <Ojbect> <Array> <Element1> <var1> ...
0
votes
2answers
32 views

ng-change is not working after one selection

I have already read this solution where @ryeballar gives the answer to the problem as that the scope of ng-repeat and controller are clashing so using either $parent/controller as syntax will solve ...
0
votes
3answers
23 views

Angular - changes to directive controller's scope aren't reflected in view

Changes to my scope variable foo are getting updated in the html. When that value is change inside the scope of a directive's controller, it isn't updating in the html. What do I need to do to make ...
0
votes
3answers
32 views

angularjs not updating model value

In my example I want to update model when user focus the textfield. In short append 'px' string to the existing value. HTML: <div ng-app> <div ng-controller="PixelCtrl"> <div> ...
1
vote
1answer
28 views

Unable to show JSON data injected using service inside the amchart directive dataprovider

I am using amcharts as a custom directive. Now I want to fetch the dataProvider of this AmChart from the output of the $http.get service using webservices. But I am unable to get this dynamically ...
3
votes
3answers
59 views

Image upload using rest api in Angularjs

I have to upload image using rest api for successfull upload will get the response of file folder destination ex: D:/ddd/download,I am not able to upload image, below is my code given suggest me any ...
0
votes
0answers
22 views

Accessing data in a directive

I'm trying to access a JSON object and return it as a list. This is from my controller.js $scope.loadClients = function() { dataFactory.getClientData() .then(function (response){ ...
1
vote
2answers
31 views

Isolated Scope not working

Here is my custom directive code (function () { var app = angular.module('CustDirMod', []); var custdirCtrl = function ($scope) { $scope.Person = { Name: 'Jagan868', ...
0
votes
1answer
26 views

AngularJS : Injecting Service in app.run

I want to initialize a globle variable "$rootScope.SegmentSelectedGlobal" at the starting of application only. This globle variable get data from a service. If i execute service through controller, ...
0
votes
1answer
36 views

Is it better to use 2 controllers for the same page's two parts

I have one page which has two parts, both parts are somewhere dependent on each other. So my question is Do I need to create 2 different controllers for that.(if yes then how i will share the $scope ...
1
vote
2answers
43 views

AngularJS using same controller for multiple views in single state

I am using angular 1.5 and UI route. Due to structure limitation we are loading under single state both filters view and content view(mostly for dataset presentation). I'm trying to achieve single-...
0
votes
0answers
85 views

AngularJs - Make use of Object in top level controller

I have several controllers with my AngularJS application. Main Controller // --- Top Level Controller --- (function () { 'use strict'; angular .module('shop') .constant("getDataUrl", "../...
0
votes
3answers
49 views

$scope is acting global

I'm trying to learn directives and I have a bunch of directives that look like my code below. But for some reason, if every directive I define has a "$scope.data" or a "$scope.takeInClick", it seems ...
0
votes
2answers
17 views

AngularJS filter data based on JSON records

I have a JSON file and want to print <divs> based upon address of resturants but I want to group them based upon the 'r.Address' field. Like all records with 'Address' Delhi should show first ...
0
votes
1answer
25 views

My ui not getting updated after updating list in the js file

<td rowspan="5" colspan="2"> <div id="style-2" class="scrollit"> <table class="table-borderless table-condensed" style="height:100px; width:100%; overflow-y:scroll"> ...
1
vote
1answer
12 views

Setting up input to update scope variables doesnt seem to work

I have a controller: .controller("myController", function($scope){ $scope.name = "Test"; $scope.desc = "Hello World!"; $scope.create = function(){ var test = {name: $scope.name, desc: $...
0
votes
1answer
23 views

How to update a field binding using a $watch when using ControllerAs

Within my angular app I have set view using ui-router: .state('search', { url: '/', views: { 'navigation': { ...
0
votes
3answers
41 views

Two attribute directives with new/isolated scope on single element

I'd like to use an AngularJS directive to disable specific parts of forms throughout the application based on whether the user has a specific role (given as attribute value; may be different per ...
0
votes
0answers
14 views

Ion-view gets title and ion-nav-buttons of previous view

The issue I have a single <ion-view>, the roles view, that is not getting it's title set correctly or <ion-nav-buttons side="right> updated. Instead it always picks up the title and ...
1
vote
1answer
25 views

How to run a function attached to an angular controller just once in a binding

I attached a function to the scope, and i wanted to run it in a binding, like this: var myApp = angular.module('myApp',[]); function MyCtrl($scope) { var count = 0; $scope.f = function () { ...
1
vote
1answer
19 views

Firing event from dynamically opened controller to parent controller in Angular js

I am developing an Web Application using Angular JS. Frankly, I am new to Angular JS. in my app I am using bootstrap.ui js for angular js. But I am having a problem with bootstrap modal controller. I ...
0
votes
2answers
26 views

Parsing parameters onclick for angularjs app

I am working on enhancing a feature of an already deployed application. All the js code is minified and i only can excess html files. I need to call a function on-click of a 'div' which parse some ...
1
vote
0answers
35 views

ng-repeat=“todo in todods” How do I access 'todo' outside of ng-repeat?

I can only access the clicked 'todo' within ng-repeat. In order to access it else where, for example within the col-sm-8 div, I have to pass it into my controller. Once I pass it in my controller, I ...
-1
votes
1answer
24 views

How to inherit functions from a parent component in angular2

I am new to angular2, feel free to help me tune my vocabulary / terminology I have a class that is composed of two directives like so: in parent.component.ts, the Parent is made up of Foo and Bar @...
0
votes
1answer
15 views

Pass Data to Service from Controller AFTER receiving info from Server

I need to pass data to an array in service after getting from server. The controller runs the function to retrieve data as shown .controller("messagesController", function($scope, $stateParams, ...
0
votes
1answer
26 views

Toggling accordion classes use angular js

I have created a custom Angular accordion menu. I have the basics working the menus open and close. One issue i am having when I click on toggle menu two i want the added class on toggle menu one to ...
1
vote
2answers
42 views

Ng-if wont render ng-repeat on the screen

I am taking a numerical input from user. I'm asking how many number of people do you want? Lets assume the user entered 3. Each "people" have a firstname and a lastname. As soon as the user enters ...
0
votes
0answers
35 views

How to fix angular bootstrap error

My project is non-angular and is using jquery. I am calling a html dialog which loads angular code. Since the dialog is dynamically loaded (in my project using ajax) I need to bootstrap at the end to ...
0
votes
3answers
43 views

Get the index of the click element

I am trying to get the index of the clicked element but I keep getting -1 in the console. I am using Array.prototype to get the indexOf from the nodelist HTML: <div ng-app='app' ng-controller='...
0
votes
2answers
28 views

Map not showing first time I enter in the screen

The following html code loads a google map: <div> Map : <div ng-controller = "CreateNewEvent" id="map" style="width: 100%; height: 400px" data-tap-disabled="true" ng-init="initMap()">...
1
vote
0answers
25 views

how to use $compile in angular component angular 1.5 and above

I am migrating from directive to component but error is getting while using $compile As : $compile(ReturnDomElement)(scope); What should be used instead Of $scope As I dont injected $scope in my ...
0
votes
1answer
23 views

Set $scope variable inside Angular Service

I have this Service in AngularJS: this.getProductsSiteService = function(idSite) { return $http.get(BASE_URL + 'obtener/productos/sitio/'+idSite); } It works fine. I use the method below for ...
0
votes
0answers
11 views

Angular Drag&Drop transclusion

I have a specific problem with two sibling-directives which are under one Controller: I want to drag the copy of a chip and not the original, so I have to copy the element on the dragstart event. It ...
0
votes
0answers
29 views

Understanding $$watchers in Angularjs

What is $$watchers? Angular keep watch on data with directives(most) and {{}}. a. How does it behaves in case of expression/filter/regular_data? b. On what watch is kept on(in case of expression/...
0
votes
0answers
22 views

Programmatical variable change in directive does not run parent scope validation

I have a form that comprises a circle in a map. The "circle picker" is implemented as a directive that renders a GoogleMaps map and updates a two-way bound object (with '=' in directive scope) from ...
0
votes
1answer
32 views

How to put the heading as the first binding and content below that while heading alone have mark

<li class="checked-list" ng-repeat="detail in ctrl.details">Your details are <strong ng-bind="detail.Id"></strong>. <br/> <span ng-bind="detail.description"></...
1
vote
1answer
17 views

Adding configuration file to Angular 1 how should the file be structured in order to use it

I have been wanting to have a central place for a configuration file with angular 1.5.8 that I can use for switching from JSON file to localhost to dev server and various other things. I noticed $...
1
vote
1answer
40 views

AngularJS: Update all objects in $scope simultaneously

Say I have an object stored in $scope like so: $scope.todo = [ { "title" : "Groceries", "todoItems" : [ { "title" : "Milk", "status" : "Not Done" }, { ...
0
votes
2answers
42 views

Angular directive scope value [duplicate]

<tab page="book"> </tab> <tab page="dial"> </tab> <tab page="groupe"> </tab> <tab page="log"> </tab> <tab page="star"> </tab> As ...
0
votes
0answers
37 views

Two way binding in angularjs directive with dynamic templateURL

This is the directive code: App.directive('postTemplate', function () { return { link: function (scope, element, attrs, model) { //console.log("doing nothing"); }, ...
0
votes
2answers
52 views

Angular ng-repeat to print array values in a HTML table

I have an array in my app.js file, contents of which I would like to print sequentially in <td> rows in my HTML table. Below is my app.js file: (function () { var app = angular.module('TravelI'...