Tagged Questions
In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
4answers
33 views
How to delete all entries from list?
I am trying to delete all entries from list using angular js. I have two directives I communicate between two directive suing shared service. I am able to add the entry in my list .
I want to delete ...
1
vote
1answer
19 views
Accessing child scope from parent
I'm having difficulties figuring how to access child scope data.
I'm using routes and ui-views to create a flow in creating a project, I have the "Wizard" which is the parent, and few more children ...
0
votes
1answer
9 views
How to add inline css in angular in different view with same content but different style?
Here my html-
<p ng-if= "editMode=='edit'" style="margin-left: 1px;margin-top: -2px;">===some messages---</p>
<p ng-if= "editMode=='addNew'" style="margin-left: ...
2
votes
1answer
81 views
how to add item in array in angular js?
I want to make two directives communicate. I have two directives: one is table directive, the other one is header directive.
On header I have two buttons "add" and delete. I want to add an element in ...
3
votes
1answer
43 views
+50
How to insert # reference in Cordova using angular js
I have a angular js application which I am trying to wrap it as a Cordova application for mobile.
The url is working fine on browser but redirection on a mobile browser has some issue. When I tried ...
2
votes
1answer
770 views
Directive: Get attr scope-value in the templateUrl function
This is the directive that I wanna build:
module.directive('templater', function () {
return {
restrict: 'A',
replace: true,
templateUrl: function (element, attrs) {
return ...
0
votes
1answer
29 views
how to add class on button click in angular?
I make a simple directive .I have two button on that directive .I am able to get click event of that button .But I want to add class on that .
I have one class
.red {
background-color: red;
}
I ...
0
votes
1answer
16 views
Access $scope from within event bound inside the directive
I am trying to access the $scope of a directive inside an element event. However, it is not happening.
When the $element blurs, the div, dyamically created, should have a class called "isok" because ...
0
votes
0answers
9 views
diagnostic.isGpsLocationEnabled phonegap plugin crash my controller scope in angularjs
I try to check GPS location enabled using phonegap plugin before send
request to server side. It's working fine. but If try to apply scope
value for hide the loader after i got response from ...
1
vote
1answer
20 views
ag-grid binding from service in external file
I'm new to angular but I'm trying to use ag-grid. I currently have a service in one file and a controller in another. I'm able to see the grid column headers but I'm unable to get the data from my ...
1
vote
2answers
41 views
$scope is not defined
myApp.controller('myController', ['$scope', function($scope) {
$scope.a = 0;
$scope.find = function() {
$scope.a += 1;
}
}])
.directive('myLoading', [function() {
if ($scope.a % 2 === ...
0
votes
1answer
19 views
how to get callback response while use $http.post method inside of GPS detector function using factory in angularjs
I try to throw error modal window when the gps not enable. perhaps
it's enabled then it will call servcie callback using $http.post
method. But without gps function it's working and return ...
2
votes
2answers
33 views
AngularJS: ng-option with key value - updating object
I am using ng-option to update my model data. But I am not able to see my selection when selecting last option from dropdown list for the first time. However in the code my model is holding that ...
4
votes
6answers
60 views
How to select first option by default in select box or drop down
I am trying to display select box using directive. But my default option is not display.
I do like this
<div>
<select ng-init="userselected = vm.data[0]"
...
0
votes
3answers
41 views
what are the directives that support one way binding in angularjs
In angularjs what are the directives that support oneway binding. ng-model supports two-way binding
Does ng-bind,{{}} expression supports one way binding ?
0
votes
1answer
97 views
Use of $rootScope value module.config throwing error
this is my app.config
app.config(['$translateProvider',function ($translateProvider) {
$translateProvider.useUrlLoader('/api/sitecore/translations/get?pageName=' + $rootScope.currentPage + ...
1
vote
0answers
12 views
i want to calculate the sum of day's hours by using angularjs
*// ***my jsp* //***
<button class="btn btn-default pull-right">Route</button><button class="btn btn-default ...
1
vote
1answer
18 views
How to call corresponding Html based on Json data value Description as filename with extensions and Path as Path?
Here Am created Some sample file. its working fine now... if I give direct Html element in Description (i.e) "Description": "Third"... But what exactly need is I will put that Html Element separate ...
502
votes
9answers
228k views
AngularJS : What is the difference between '@' and '=' in directive scope
I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle.
And here are some relevant snippets:
from the html:
<pane ...
0
votes
3answers
33 views
change controller $scope from a directive
I have a controller:
function myController($scope) {
$scope.clicked = false;
}
and a directive:
function myDirective() {
return {
restrict: 'E',
link: function(scope, ...
1
vote
2answers
123 views
ng-repeat not updating when pushing objects to the array
I have been taking a course on Angular JS on Coursera and I am having trouble with ng-repeat not updating my view after I push something on the array using a form. When I tried to log the contents of ...
0
votes
1answer
61 views
Angular - Controller can't see my variables in html
I'm here because i am not being able to make my controller see my html variables our functions, maybe you guys see something i dont =(
HTML:
<article ng-controller="CreateUserController">
...
13
votes
2answers
8k views
Reinitialize an Angular.js controller
if you have a controller to manipulate $scope variables in Angular.js, is there an idiomatic way to:
reset the controller's $scope, and
restart controller initialization?
For complex controllers ...
0
votes
0answers
25 views
how to import file in angular js and in which sequence need to import?
I make a controller in demo .I try to test using karma, jasmine to test my controller.But I have issue of importing the file .
I want to know how to import the file and what is the sequence of ...
1
vote
1answer
55 views
why the message property is undefined?
I make one controller in Angularjs and try to test that controller using Jasmine. I got this error Cannot read property 'message' of undefined why ?
Here is my code.
controller
(function(){
'use ...
2
votes
1answer
28 views
Module 'templates' is not available! in angular js?
I am trying to test directive in angular using Jasmine. I installed karma-ng-html2js-preprocessor using NPM. Then I istalled jQuery using Bower but I am getting this error
Connected on socket ...
0
votes
0answers
44 views
how to check property of directive in angular js?
I am a simple directive with isolated scope .I need to test that directive using jasmine and karma .I make this directive like that
.directive('helloWorld',function(){
return {
...
0
votes
3answers
59 views
AngularJS: Building a form with nested ng-repeat and dynamically created inputs
I'm building a form that should support entering attributes for multiple instances of the same product. To allow a user to create an arbitrary number of instances I'm using ng-repeat and building an ...
0
votes
3answers
30 views
$emit not working while emit data from one controller to another controller in angularjs
i try to call function while emit data from one controller to another
in angularjs. but it doesn't work for me in angular v.1.2. I need to call ctrl1 function from ctrl2. anyone can
give me ...
0
votes
1answer
27 views
how to call function of page1(service1.html) controller( ctrl1 ) from another page2(service2.html) controller( ctrl2 ) in angularjs
I try to call function of page1(service1.html) controller( ctrl1 )
from another page2(service2.html) controller( ctrl2 ) in angularjs.
The both page has parent controller (parentctrl). Anyone ...
0
votes
1answer
17 views
isolate scope on a directive restricted to attributes
In the documentation for directives you can isolate scope with the following:
.directive('myDialog', function() {
return {
restrict: 'E',
transclude: true,
scope: {
'close': ...
0
votes
3answers
68 views
how to add partial page functionality using $http service in angular?
I want to perform operation after successfully loaded the partial page using $http service in angular.
The operation is to check the checkbox based on the scope value.
Please anyone help me.
Source ...
1
vote
1answer
29 views
how to check the property of object in angular?
I am trying to update the property of object after calling $http request .And I also test that value using karma jasmine.But my test is fail why ?
Initial value of my object property is
...
1
vote
2answers
33 views
how to test $http call in angular js?
I am trying to test my $http request using karma and jasmine.I make one controller and inject a service .In service I call $http service.I need to test that service how I will test this service this ...
1
vote
1answer
32 views
why ng-repeat not work in directive using angular?
I am trying to use directive in mu page ..I am trying to send data from controller to directive .I am trying to display data using ng-repeat.
here is I am applying the ng-repeat .
<div ...
0
votes
1answer
28 views
Ng-repeat and Native scrolling creating issue with scope loading
I am creating hybrid application and i am facing issue in ng-repeat with native scrolling.
Below are my template file code
<ion-view align-title="center">
<ion-content class="ionic ...
-1
votes
1answer
4k views
Angular Translate Use with Directive
Here's fiddle link .... I am trying to update the content of directive with $translate and using the controller. Is there any other generic way to do the same thing(link in directive?? ) .If i want ...
2
votes
1answer
36 views
(ionic) How to share variables(from server) to 'search' relative pages?
This is my task: Get search selections from server when route to a search page or it child pages (eg: #/search/option1). The problem is how to share the selections to all search relative pages and ...
-1
votes
2answers
21 views
how to add different style for two different view in Angular?
I have two view editmode:"New" and editmode:"edit" and trying to add different style for a paragraph, how to do that?
<p style="margin-left: 165px;margin-top: -23px;">===some ...
0
votes
2answers
51 views
AngularJS, Factory, $scope and promise struggle
So I am having some struggle with the code below:
app.factory('sfAttachment', ['$http', '$q', '$window', '$rootScope', function($http, $q, $window, $rootScope) {
var attachment = {};
//Save to ...
0
votes
0answers
9 views
override ionic afertEnter event on extended controller
I extended an angularjs controller, using extend method into the child controller in this way.
into the child controller i do to extend:
angular.extend(this, $controller('DispositiveController', {
...
0
votes
1answer
19 views
angular $resource call success callback with actual array variable?
I am a beginner in angular world.
The problem I'm facing is that i have a custom array ($scope.picking.operations) and i can add many objects to this array (with a boolean send set to false), then ...
545
votes
11answers
221k views
How to access the $scope variable in browser's console using AngularJS?
I would like to access my $scope variable in Chrome's JavaScript console. How do I do that?
I can neither see $scope nor the name of my module myapp in the console as variables.
0
votes
0answers
32 views
$location.path not redirecting in Angular Service on mobile when used with Cordova
I have a angular service that redirects to url after authentication.
The code
$location.path(url);
Works fine on all the browsers. I am packaging this angular code as iOS and ...
-1
votes
1answer
22 views
How do I make sure that my do button will mark the specific task as requested do.
I have tasks listed and each task has both a "Do" button and a "Fund" button.
Once I click on the "Do" button or "fund" button, I want the specific task to be assigned to a state of "DoRequested" or ...
0
votes
2answers
36 views
how to apply filter in angular js which is not visible?
I am trying to apply filter in list view .Whenever I typed anything in input field it filter my list .I am able to filter when I write username which is visible to user .example when I write "pa" it ...
1
vote
1answer
45 views
Angular ng-click not working for ng-show
i have list of data and using ng-repeat to show them
<div class="modal-body">
<input class="form-control input-lg" type="text" ng-model="providerPicked" placeholder="Cari ...
1
vote
1answer
19 views
The best way to multiple check is in array in angular
i want the best way to check if a value is in array in angular, this test is verified 2 time in my html. This is a very simple example to explain my problem:
in scope:
$scope.flaggedItems = ['a', ...
0
votes
3answers
57 views
whole number pad with zeros
I have a directive that convert to 2 decimal places (input number textbox) and
it is working well but I would like to pad the whole number with zeros.
Anyone knows how I can achieve whole number ...
0
votes
1answer
16 views
ng-onclick appears to know about changes before $scope
I keep running into a problem where I need to pass through properties on $scope through an ng-click in order to have access to the property within the ng-click method. One of the issues is that ...