In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
8 views
Angularjs $scope is not working as I expected, why is that?
I'm just giving my first steps on AngularJs and I have a question that maybe you can help to understand the reason for the result I'm having.
Here is the link for jsBin to make it simpler to ...
1
vote
2answers
39 views
AngularJS - Change properties of a class from a controller
I won't harp on about the use-case for this (it's needed to override some behaviour in Angular Material which is causing bugs in Safari), but here's what I'm trying to do:
HTML:
<style>
...
0
votes
4answers
27 views
Using Angular $http in a service to fire on ng-click
I am currently using Angular 1.3.14 and I would like to make an request using $http whenever a link is clicked. I am trying to place the $http request in a service so it's not bound to any one ...
0
votes
1answer
23 views
AngularJS: Ng:init - how to assign ng:model?
I have ng:repeat, created by json (methods), inside it creates a series of radio buttons that are characterized by iteration (method).
Below, I need to create a variable that will be based on method ...
0
votes
1answer
38 views
AngularJS - Update Chart Data from Input
I’m new to angularJS and I’m having some issues updating chart data from an input using some calculations. I have an main html file and an app.js file with my controller.
I’m looking to:
Have the ...
1
vote
2answers
18 views
Update Directive Scope After Controller Service Call
I have a controller, which calls a service that performs a $http.get
app.controller('myController', function ($scope, mService) {
$scope.chair;
myService.getData().then(function (data) {
...
0
votes
1answer
42 views
Cannot get form data with ng-model
So I have two forms inside the same controller.
<form name="myForm" id="myForm" class="form-horizontal" ng-submit="saveMyForm(myForm)" >
<input type="text" id="name" ng-model="name" ...
0
votes
0answers
26 views
Angular.Js input[date] validation
Here is my form:
<form name="user_submission" novalidate="novalidate" method="post">
<input type="date" name="date_of_birth" ng-focus="save_data()" ng-model-options="{timezone: ...
0
votes
3answers
19 views
Angularjs scope length outside function
Im a newbie in AngularJs and do not really know how to get length of response outside function.
var onUsers = function(response){
$scope.users = response.data;
...
0
votes
1answer
55 views
How to get the length of an array without ngRepeat
I'm trying to count the items in an array without using ng-repeat (I don't really need it, i just want to print out the sum).
This is what I've done so far: ...
2
votes
1answer
29 views
Directive not getting attributes correctly [duplicate]
I have a directive that wraps jQuery FullCalendar plugin.
This is how I use the directive
<div sg-calendar
format-column-header-month='dddd'
format-column-header-week='ddd/dd'
...
1
vote
1answer
22 views
Angular 1.x directive shared scope with controllerAs parent
I'm trying to create a directive that calls a method defined on the parent controller.
I've made a plnkr here
I'm using controller as 'vm' for the parent controller. The method is not invoked on the ...
0
votes
0answers
29 views
When is angularjs $scope.on(“$destroy”) event actually fired?
I've been fiddling around with it and it doesn't seem to fire on going to another state
I've few intervals that I need to clear every time a state is changed but I can't get the $destroy event to ...
0
votes
1answer
16 views
AngularJS Get text selection and append html to start and end of selection
Have little dilemma here. I'm building text editor in angular js. The problem that I have is, when user selects part of text within a paragraph or heading I need to change styling of that part of text ...
0
votes
1answer
18 views
$scope.$emit not work in callback?
I have a code to authentication where I want call an event after receive some data, but "$scope.$emit" not working in the callback of "User.me()" and I not understand.
Anybody can explain me?
...
0
votes
0answers
19 views
AngularJS - $$ChildScope Vs $$childHead && $$childTail
angular.element($0).scope() gives $$ChildScope, $$childHead and $$childTail as members.
On debugging, $$childHead and $$childTail shows the immediate child scopes.
What does $$ChildScope signify?
0
votes
1answer
14 views
AngularJS: Image upload + FileReader preview. Trouble binding between controller, directive and scope
I'm relatively new to Angular and are stilling trying to wrap my head around all it's magic and scoping.
I'm trying to do a simple image upload with preview script and I'm missing the final piece.
I ...
0
votes
1answer
42 views
Angular-ui validation not working in model window
I am working on AngularJS with ui-grid. In the grid when i edit a row I am opening a modal window like this
$scope.editRow = function(row){
var modalInstance = $modal.open({
...
0
votes
1answer
22 views
Error loading base64 images with Angular
In my Angular app, I'm loading some images which I download from server as base64.
I can see the images in the app without problem, but I have this errors in the console:
This is my code:
<img ...
0
votes
3answers
38 views
How to set flag for object without affect other $scope value in angularjs?
Here I added sample for Move Items From One List to Another
While Am move the Item that time I need to set flag as 'D' for moving item from where I am moving and I need to set flag as 'A' for moved ...
0
votes
1answer
51 views
How do I get a Scope for the first element of an array
I'm using AngularJS and Firebase and I have the below which is fine
var myTeam = Teams.child(thisTeam);
var myFixtures = myTeam.child("fixtures").startAt(now).orderByChild("date");
$scope.team = ...
0
votes
1answer
26 views
how to get a json result from $http.get in ionic
I have a big issue from the data I return from the server, the $scope.$apply function strips the value and I can't manipulate my data.
The data returned from the server:
...
0
votes
1answer
14 views
scope child head/tail is null
I am working on an AngularJs app, I am using a directive and a controller
the directive is responsible for fetching a list of sates and on select state a new list of cities are generated
now I want ...
0
votes
1answer
13 views
In my angularJS controller am appending the URL with a dynamic value from the view, but getting undefined value
Below is my view, from the view I am using the id which is appended to the particular URL in the controller to retrieve corresponding Book
<div ng-controller="viewBookController">
<form ...
0
votes
3answers
39 views
Two way binding in Angular JS
I get a problem with follwoing code.
my html page code :
<body ng-app="myapp">
<div ng-controller="myController">
The message is {{message}}
<input type="button" ...
0
votes
0answers
20 views
implementation of angular scope and constructor
angular.module('appCtrl',[],function($scope,$http,$interval){
$scope.tick = 100;
$interval(function(){
$scope.tick -= 1;
},1000);
})
how to implement a constructor function ...
0
votes
1answer
14 views
Angularjs passing variable to a directive's controller
I am creating Angularjs Directive. However i need to pass a paramter to the directive and use it in its controller to populate its items using $http service.
i am passing a "listId" parameter to the ...
1
vote
1answer
22 views
CSS class helper (Angularjs)
I use this module https://github.com/rpocklin/angular-scroll-animate
i try create new attribute when-visible-class="animated fadeInUp" but i get error
Directive: angular-scroll-animate ...
0
votes
1answer
33 views
Angularjs ng-change
Hi I have two fields
<input
type="text"
ng-model="postFlightData.schedule_date"
ng-change="getFlightNo()"
>
this will populate the select option here
...
4
votes
2answers
43 views
Angular $scope won't update in bootbox callback
This is my first question on SO.
When I splice an element of an array on the scope, that change is not reflected, when done in a callback of bootbox.js.
Works:
$scope.deleteA = function() {
if ...
0
votes
2answers
36 views
Suitable event for hidden column on UI grid
I am using ui grid.
http://ui-grid.info/docs/#/tutorial
In that there is option hide column. I want to get event when user hide the column. I want to show alert when column is hidden? Is there ...
2
votes
1answer
33 views
how to get event when column changed it position?
I am using UI-grid .In that I am using column moving functionality from here .
http://ui-grid.info/docs/#/tutorial/217_column_moving
Using that user change grid column position .I want a event when ...
0
votes
1answer
17 views
reacting on my parent controller to be done with loading
I have a MainController that loads an array of Objects via RestAngular
controllers.controller('MainController', $scope, Restangular) {
$scope.colors = {};
...
0
votes
1answer
36 views
AngularJS Drag and Drop event listner not working
By studying article i am trying to develop my drag and drop but it is not working. Here is My Code.
The issue i am facing is my events are not firing. can anyone help me for this?
when i move swipe ...
0
votes
1answer
43 views
ngRepeat not updating even though list is
I'm having a problem where despite a list being updated, ngRepeat does not display the information.
In the code below, the $scope.selectedImages array is being added to when images are selected using ...
0
votes
1answer
20 views
AngularJS - attach same controller to multiple html elements
I have a sample HTML like this where each div represent tons of html code.
I need to attach a piece of html code to a controller which is already attached to one div.
Both the first and last div ...
0
votes
0answers
35 views
angularJs ngDialog isolate her scope instead of sharing it with parent
I'm using Angular 1.5 and ngDialog.
I have a werd problem i cannot reproduce in plunkr... ( http://plnkr.co/edit/xqK8ZlyTHi2dcFQXDOtX?p=preview )
What i want to do :
1) I have an array ('list') in ...
0
votes
0answers
27 views
Add a function to html string in link layer of directive
I got this directive which renders a list of objects. this objects got it's own function, i wanna bind it to a button. So i run over my items.In my objects value, i got a prop called Action which ...
0
votes
1answer
35 views
factory/service data being overwritten by next call to API endpoint
Im having issues with populating 2 highcharts graphs on a single page using a factory or service endpoint to grab my data automatically. Ive setup a directive which is working fine, i can see the ...
0
votes
1answer
18 views
How do you $watchCollection multiple attributes in AngularJS?
Just like you can do $watchGroup to $watch multiple attributes, is there a way to do the similar for $watchCollection something like $watchCollectionGroup?
I do not want to $watch deep using the ...
0
votes
1answer
36 views
I'd like to two bind a directive's scope, it appears its only one way bound?
What I'd like to do is very simple: two way bind a directive's scope. This means given a Parent controller ParentCtrl with $scope.name='Foo' and a directive with scope: {name: '='} I'd expect that ...
0
votes
1answer
25 views
Angular UI Router- insert param in url
Working on a project where I am required to show url link and render data based on the param/id I pass in my url. In the following link AWS is the id.
link: ...
1
vote
1answer
15 views
Launching modal on parent from a directive
I have a view with a ui.bootstrap modal that has its own controller.
In the view, i have a directive that generates a number of buttons with a unique ID.
I want to be able to click on one of the ...
0
votes
1answer
21 views
Print data only in form on-click Print button AngularJS
I have multiple add-remove input field rows in my form. This is nothing but a report. There is a print button and I want to print only data entered in form in structured manner. Similar like ...
-2
votes
0answers
14 views
Add directives from directive in AngularJS (CSS class helper)
It would be great to have a CSS class helper in order to use it like this:
when-visible-class="animated fadeInUp"
I'm using this script https://github.com/rpocklin/angular-scroll-animate
Any idea ...
0
votes
2answers
29 views
$Scope doesn't work on subpage
this is my controller,
.state('tabs.urunler',{
url:'/urunler',
views:{
'urunler-tab':{
templateUrl:'pages/urunler.html',
controller:'MyCtrl'
}
}
})
...
0
votes
0answers
29 views
Angularjs “Cannot read property 'childNodes' of undefined” on route change
There are a bunch of these very vague error questions on Stack, but none have been helpful for me here.
When I change routes (also going from one controller to another), I'm getting this error:
...
0
votes
1answer
15 views
Ability to covert 30k to 30000 requires user to click outside box to enable change-pressing enter on the keyboard should work as well
The user key in "30k" and tab out to "30,000" will be displayed.I want to add the "enter" functionality in my directive code.The directive code is below.Can any one help me out with the function?
/*! ...
0
votes
1answer
29 views
How do inject services to Link function contained directive?
I am trying to inject services to the below directive which is used link function instead of controller.
(function() {
angular
.module("myApp")
...
0
votes
3answers
35 views
Angular.js: custom directive
I am trying to add custom directive in my app. But it is not getting called on button click event.
my controller-
appServices.directive('customClick', function() {
return {
restrict: 'E',
...