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
0answers
9 views

Using Angular Material Design ng-model date format works but firebug throws error

I am trying to format a date time and it works but, firebug throws an error This is my code. <md-input-container> <input ng-model="item.myDate| date:'yyyy-MM-dd'" disabled=""/> ...
0
votes
1answer
19 views

why image is not display in angular js?

I make a simple demo of jstree using angular js .I read this documentation https://github.com/ezraroi/ngJsTree before making the example Both codepen have same JS Code .But one code pen show ...
0
votes
1answer
12 views

How to make “checked” on md-radio-button in Angular

I need to check an md-radio button. I saw on their website that they do it in scope in app.js but need to do it dynamically. I have tried with ng-checked but didn't work. Is there any way to modify ...
0
votes
2answers
25 views

Angular js autocomplete typeahead

I need to implement angular js typeahead directive for searching cities based on a particular country. Both should be autocomplete dropdowns. That is when I type in the country text box it should ...
0
votes
1answer
39 views

why the controller not working in angiular js?

I am trying to implement jstree in angular .I used this plugin https://github.com/ezraroi/ngJsTree I am getting this error b.tree.jstree is not a function I follow all steps and make a codepen but ...
0
votes
1answer
40 views

Angular directive controller scope inheritance

Lets start with some code Html: <rd-search-set type="'ActiveProfileContact'"> <form class="navbar-form navbar-static-top" role="search"> <rds-input /> </form> ...
0
votes
0answers
23 views

Select Tag Data Bind Issue In AnjularJS

I have a strange Issue in Angular JS, where I am not able to data bind data to a Select control. Let me explain the issue. I am dynamically creating controls in my application, all the information ...
1
vote
1answer
22 views

Call the output of a function in a controller

I have a function that runs in my html code and I'm having trouble calling that function to do more things with the output in the controller. To start off with, here is my JS: (function(angular) { ...
1
vote
1answer
32 views

how to add watcher in angular js?

I am trying add watcher in my demo.I am able to add watch in object like that $scope.$watch('username',function(newvalue,oldvalue){ console.log(newvalue +":"+oldvalue); ...
0
votes
1answer
31 views

How to call $http request [duplicate]

I am trying to make a demo of $http request and test that service also..I do like this .controller('cntrl',function($scope,appfactory,$http){ $scope.data=[]; appfactory.setValue('test abc'); ...
1
vote
1answer
21 views

how to remove Unexpected request: GET data.json?

I am trying to use $httpBackend to test my $http request ..i AM getting this error Unexpected request: GET data.json No more request expected here is my testing code ...
3
votes
2answers
37 views

Dynamically add a directive

I'm generating a report with collection of questions. app.controller('reportCtrl', ['$scope','$stateParams', function ($scope, $stateParams) { $scope.questions: [ { questionkey: 1, ...
4
votes
2answers
32 views

How does the createSpy work in Angular + Jasmine?

I made a simple demo of a factory and I am trying to test this using jasmine. I am able to run the test but I am using the spyOn method. I would rather use jasmine.createSpy or jasmine.createSpyObj to ...
1
vote
1answer
27 views

Do we really need “pascalprecht.translate” in input directive.?

I have a input directive which supports translate. The directive has two property input label supports translate. My doubt is the app which need has support translate will have the ...
0
votes
2answers
35 views

Multipart/form-data form sending data with AngularJS

I need to post form data as below to URL which is a webapi and the method is post var surveyData = { Name: xyz, SetReminder: 'false', NoOfReminder: '0', ...
0
votes
3answers
26 views

not able to access $scope object outside a http response callback function in angularjs

I have this controller for saving some details for an individual. I have a separate repository EntityRepository where a function to get the user gender from database is defined. The function response ...
6
votes
2answers
65 views

why splice not work properly in angular js

I am trying to make one demo in which i have one checkbox list .I am able to display the list using ng-repeat . What I need if user click on one check box(only one checkbox is checked) .it display ...
1
vote
1answer
46 views

how to use ng-repeat in columns in angular?

I am trying to make one demo in which i have one checkbox list .I am able to display the list using ng-repeat . But I am tying to generate dynamic columns ..I know bootstrap grid system (12 column ...
6
votes
2answers
81 views

Share data between directive scope and controller $scope?

Here I created some sample for date picker, which is working fine but I need to set min and max date dynamically.. so i am passing the start and end date from Html like this my-datepicker ...
1
vote
1answer
27 views

Angular directives with a shared controller don't share the controller's $scope

If I have two different directives with isolated scopes, and they share a controller, shouldn't they share the controller's $scope? Effectively, I have the following scenario: I call to the ...
1
vote
1answer
27 views

$scope passing has a Delay

I'm building an Angular pop-up system for multiple purposes. The way it works is that I have a directive called bitPopup which three variables get passed on to (type, action and data) as shown below: ...
6
votes
1answer
78 views

How to create directive for this date picker example?

I am new for angularjs here i created some sample for date-picker, which is working fine. I want to create a directive for this sample.. i tried its working but after selected the date it show format ...
4
votes
3answers
183 views

Angular scope and ng-click / ng-show to set multiple divs

I am looking for some help with my code I have so far. The main objective is to be able to click on any Plus icon and have it place a cover over all other div blocks. And when a plus icon is ...
0
votes
1answer
22 views

how to get rootScope value from routeChangeSuccess angularjs

I'm trying to get rootScope value in function from routeChangeSuccess in AngularJs as per following code. But I cannot convince why rootScope value is NULL when I output with console.log. ...
0
votes
0answers
14 views

Upward count and conditional class in a nested object using ng-repeat

How do I upward count inside a ng-repeat? This is my JSON response { "file_service":{ "delete_file_service_test":{ "TestDeleteFileService":[ { ...
-1
votes
1answer
45 views

Enable/Disable button by selected value in drop down list using AngularJS

I have one button called test and one drop-down menu with three values. How to enable-disable Test button according to value selected in drop down menu. Eg. If selected "Not Ready" , button should ...
1
vote
0answers
33 views

Angular JS - Destroy issue clean scope in global way by $destroy

i'm using angular 1.4.8 version My App are complex and have a lot of directives which nested each others, I want to prevent a memory leaks in case when the developers are not cleaning after them self ...
2
votes
1answer
20 views

How can I access the function in child directive which passed from parent directive but defined in controller?

I have a parent directive and a child direcive, all in a controller, view is here: <body ng-app="myApp"> <section ng-controller="TestController"> <section parent-directive ...
1
vote
1answer
17 views

bind controller on dynamic HTML

I have a HTML page with different sections, which are loaded with AJAX. I have created a controller for each of the sections. How is possible to bind the controller on a section which has been ...
0
votes
1answer
28 views

Angular 'this' doesn't assign value

I have the following code, and the problem is, that value fetched from json is not assigned to the vm variable (function() { angular .module('app', []) ...
0
votes
1answer
23 views

Chart.js not drawing with AngularJS

For some reason this chart won't draw when i try to do it with AngularJS. It seems to work fine if i do it without AngularJS so the problem seems to be related to it. I don't get any error in console ...
0
votes
0answers
21 views

Scope not being processed within a sub directive

My directive inserts a summernote directive within the template, but the placeholder is not being processed. The {{placeholder}} is still {{placeholder}} within summernote's link function. It works ...
0
votes
0answers
12 views

AngularJS SPA Framework routing issue

I was trying to learn some advanced angularjs from plural sight and was creating a SPA framework similar to the author. But I got stuck in the routing part where I was not able to display my contents ...
0
votes
1answer
22 views

Using ng-class based on ng-cookies stored data

I am trying to use ng-class based on condition inside a function but sometimes the toggle does not work. i used $scope.getBookmarkIcon function so that i can get ng-class selected with bookmarkIcon ...
1
vote
1answer
22 views

Display dynamic content in Angular Modal from parent controller

I am using angular-modal-service. I wish to modify the content of modal body as custom input text from the user. My index.html looks like : <head> <link rel="import" href="notify.html"> ...
0
votes
0answers
14 views

Force angular scope to bind input value to model and add ng-dirty, ng-touched classes

Basically I have a text input element within my scope. This input is set to a model property using the standard ng-model=someobj.address attribute. The problem I have is that the value in this input ...
1
vote
1answer
31 views

Can't hide form from inside itself changing showForm value because it is undefined

I was making a small "Reading List" application following guides of Soup to Bits: Shaping up with Angular.js video I didn't like the way they put "Cancel" button at the top and just for practice ...
0
votes
3answers
42 views

pass data from controller to directive's link?

In my controller : myApp.controller('homeCtrl', function($scope, $rootScope, $state, 'red'; $rootScope.$on('new_story', function(event, data) { $scope.cardObj = {key:'value'}; }); ...
1
vote
2answers
30 views

Angular directive scope work differently with replace value

I have a directive with source code shown below: var app = angular.module("myApp", ["mytemplate.html"]) var thai = angular.module("mytemplate.html", []).run(['$templateCache', function ...
0
votes
1answer
55 views

AngularJs - Code accessing $scope variable before it is ready

I have a controller (MyCtrl). The first thing that is to be done is to make a http.get call and get the response and assign it to $scope.input. The rest of the controller depends on $scope.input. But ...
0
votes
1answer
18 views

Angular: accessing directive attributes in controller constructor

(Using Angular 1.5) I am trying to use the following design pattern for my angular app: angular.module("app").directive("MyDirective", MyDirective); function MyDirective () { return { ...
0
votes
0answers
14 views

Callback function does not change my Angular $scope [duplicate]

onThirdPartyLogin authenticates a Firebase client using a popup-based OAuth flow and is executed on button click. When authentication has completed, callback authHandler will be called. On failure, I ...
0
votes
2answers
31 views

Can anyone explain the core concept of model in angularjs?

HTML Code: <mydirective></mydirective> <input type="button" ng-click="showText()" value="Show Service Text" /> Js Code: var app = angular.module('demo', []); ...
1
vote
0answers
33 views

angularjs directives error

I'm trying to create an interface that allows users to rate songs. There are 6 options, ranging from 1 to 6. I want to change the css of the button upon clicking it. There are several songs, and I ...
0
votes
2answers
20 views

input radio not updating the model

I created a directive that uses a template, and after using this directive, the input type=radio is not updating the model anymore. Normal text-types work ok. What should I do to keep the model ...
2
votes
3answers
39 views

Why use $rootScope to share data across controllers when factories can do the same thing?

My understanding is that $rootScope is some kind of global variable which allows it to be shared across controllers. Factories can also do the same thing. So, why not use a factory instead? When ...
2
votes
1answer
36 views

Error: Error: Cannot find module ' in angular js?

I try to make simple app ..try to test using protractor ? I install every thing .and able to run protractor given example ..than I make my own example like this Index.html .. <!DOCTYPE html> ...
0
votes
2answers
31 views

Getting Undefined in controller

I'm trying to get the value from service and then printing that value in console log which is giving me undefined in controller. The value from service is being returned properly. But I'm not able ...
0
votes
1answer
34 views

How bind an object from $q.all promise to $scope in AngularJS?

In my application, I have a service creating a new structure with two json files. So, I use $q.all to use them in a same time. angular.module('myApp', []).factory('myService', ['$http', '$q', ...
1
vote
1answer
34 views

Send $scope between controller and Module

I've been stuck on a problem for 4 days. I use a plugin Autocomplete, a directive for AngularJS that uses a script in my html template. I customized this to add a button that open a modal to add ...