Tagged Questions
In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
0
votes
1answer
19 views
AngularJs - Injecting child module into other child module
I have a scenario which might sound stupid but I'm stuck and trying to understanding what might be causing it to not work.
I have an angular app which has three modules for now
var app = ...
0
votes
1answer
20 views
Error after using ngAnimate: TypeError: Cannot read property 'ng-scope' and 'col-sm-6' of undefined
I've added angular animation to my project. I only placed this to my index.html and app.js. Is there something I've missed? Thanks in advance
Index.html
<script ...
1
vote
1answer
13 views
Passing data to angular function on changing html slider input
I want to pass a value on changing the html slider input in AngularJs.
<input type="range" value="30" min="0" max="0" id="set-value" />
Angular function:
$scope.passValueHere = ...
0
votes
2answers
18 views
What to use to set styling dynamically in Angular?
I started working with angular and creating my "little" project. I came up to templating issue.
Basically, I try to set colour for elements dynamically with angular. I can't figure out what would be ...
0
votes
1answer
18 views
AngularJS $watch doesn't wait for trigger to happen, executes the $scope inside the callback function
I have the below code
Fiddler Link
Html:
<div ng-app ng-controller="ParentCtrl" ng-init="cities='North America'">
<div ng-controller="ChildCtrl as vm">
...
-4
votes
1answer
44 views
Understand the angular & in isolated scope and tits ()()
I wandering why when I'm passing method from outer scope to directive with isolated scope using '&' I need to call this method in directive with with double brackets ()().
It's looking like the ...
0
votes
1answer
16 views
why httpbackend not working in angular?
I am trying to test $http webservice using $httpBackend ? I am getting a error in that . how to test service using $httpbackend ?
here is my code
http://plnkr.co/edit/S3LFymv8hrxtatWaCv1A?p=preview
...
0
votes
0answers
5 views
how to test directive in angular class apply or not on label?
I make one directive in which label or text don't have this class
.selected{
background-color:red;
}
but when button is click the button it apply the .selected class on label .Now I want to test ...
0
votes
0answers
27 views
why navigation test failed in angular?
I am navigate from one page to another on button click using angular ?.I am able to navigate .But I am trying to test that scenario .I am getting a error .here is my code
...
0
votes
1answer
14 views
404 Image not found on ng-repeat in ionic / angular for first image only
So I am using the following code to output a few images on my html page
<div ng-repeat="Object in Objects"><img src="{{Object.Image}}"></div>
This works great and loops out all my ...
0
votes
1answer
29 views
Angularjs Join two scope arrays
How do I join two scope arrays into one in angularjs in my controller so that I can display them in a single table? The join would happen on a field which is in both tables. It would be like a typical ...
4
votes
2answers
38 views
AngularJS: how to assign service method to controller $scope and ng-repeat (it) in view?
I'm trying to separate functionality from controller and put it in service so I can use it in multiple controllers without adding same piece of functionality across different controllers.
My original ...
0
votes
1answer
29 views
need to remove orderBy filter on ng repeat on condition basis
In my AngularJS application by default, I have $scope.initialLoad = false. In that case I need to have ng-repeat as ng-repeat="tab in logBookCtrl.tempLoadTabsToDeleted | orderBy:'age' ", as shown ...
0
votes
1answer
18 views
How to introduce constants (Angular-Translate) in angular roots
I have just implemented async translations on my site using this guide;
https://scotch.io/tutorials/internationalization-of-angularjs-applications
They use this code to load the preferred language ...
2
votes
1answer
47 views
Ng-show will not update when ng-click is inside div
I have a DIV with ng-show.
When I run ng-click on an element outside of the DIV, it works fine and I can hide it.
When I run ng-click on an element inside of the DIV, it does not work. I can see ...
-1
votes
0answers
19 views
When is =? used in angulars js directive? [duplicate]
I understand that =, @, & are used in angular js scope isolation for directive. But I came across an example which uses '=?'. For what purpose do we use it?
Example:
scope: {
floor ...
0
votes
1answer
33 views
Import file issue in angular 2
I made a simple program of hello text in angular 2.I am able to make that program but i have some problem in understanding?
Here is my code
http://plnkr.co/edit/BPdzCZeXbyzQrgmLzO86?p=preview
I ...
0
votes
0answers
15 views
How do I get my dual binding to work properly with bootstrap datetime picker? [duplicate]
For background, I am using angular, along with bootstrap datetime picker
My problem appears to be that my angular binding is working in one direction, but not the other. Let me first provide some ...
0
votes
1answer
10 views
connected trees in ui-tree drag n drop prevention
I am using I'm using :
http://angular-ui-tree.github.io/angular-ui-tree/#/connected-trees
I want to be able to drag on parent level but not on child level in the tree.
How would I go about that. I ...
1
vote
0answers
16 views
How can you pass rails controller data to angular templates assets to create forms?
Is it possible to make methods and data in a rails controller be accessible in an html.erb asset to be passed to angular?
For example, a form to create groups might look like:
<%= form_for ...
0
votes
1answer
36 views
ng-bind not updating after closing modal form
I have a view with one list item. After user clicked on this item, the modal form show. When user change value and close modal, the item-not not updating.
View:
<ion-view ...
1
vote
1answer
18 views
Angularjs undefined function Error: ng:areq Bad Argument
I am taking baby steps learning angularjs from video tutorial and as i reached the controllers section i had this error:
Argument 'SimpleController' is not a function, got undefined
although i ...
0
votes
0answers
38 views
EXCEPTION: No provider for $scope! (function (scope, elementRef) { -> $scope)
I am using ngUpgrade to use an angular1 directive in my angular2 app. I followed the steps mentioned on angular2 upgrade guide
See this plunk for code.
It is resulting me into this error -
...
0
votes
1answer
14 views
Strange behaviour when adding directive dynamically in ngrepeat
I am trying to add a directive dynamically inside ngrepeat. Please refer to the following fiddle link: Fiddle Link
Code:
// Code goes here
var app = angular.module('myApp',[]);
// myDir Directive
...
0
votes
1answer
24 views
Some prbm in angularjs lib default value is not working in select if(value and name) same? [duplicate]
Here I create sample for select in angular... Which is working fine.. I tried to set default value for select if I set this $scope.selectedValue = "SureshRaina";
working fine... but if I set this ...
0
votes
1answer
23 views
how to save entry in table in angular?
I'm creating a simple demo using this link
http://ui-grid.info/docs/#/tutorial/101_intro .
I am able to get click event (Please click on first column edit image). It shows a modal. I open a modal on ...
0
votes
2answers
27 views
$scope in controller is not accessible in view / data binding not working (IONIC/ANGULAR)
In my controller:
.controller('ContactCtrl', function($scope, $stateParams, lodash) {
$scope.selectedContact = lodash.findWhere($scope.businesscards, { Id: parseInt($stateParams.contactId) });
...
0
votes
3answers
43 views
Unable to display angular variable value in a modal box
{{$scope.custdata[0].email_id}} below is not working. I tried {{$scope.email_id}} and {{email_id}} etc in its place and none is working. I also tried to view debugger and no error is displayed. The ...
0
votes
1answer
25 views
why click event not show alert in angular js library?
I make a simple demo in which I make custom cell of table like that
{
field: 'id',
name: '',
enableColumnMenu: false,
cellTemplate: ...
1
vote
3answers
41 views
AngularJS - How to get isolated directive scope variable in link function?
See my code below.
directive:
app.directive("filterTree", function() {
return {
restrict: "AE",
controller: function($scope, $http){
$scope.treeNodes = [];
...
0
votes
0answers
28 views
How to implement base class derived class in angularjs?
Hi I am new for angularJs. In angularJs how to implement base class derived class concept?. In base class I need to create some common methods and in derived class I need to override that common ...
1
vote
1answer
30 views
why is the image not displayed in angular?
I built a table in my demo. I got help from this example.
In this example, first column there is an image of "edit image" (coming from bootstrap).
I also make same example in my plunker, already ...
0
votes
1answer
14 views
how to remove hide column option in angular?
ui-grid in my demo .here is the api document
http://ui-grid.info/docs/#/tutorial/101_intro
I want to remove hide option from the columns .In each columns there is "V" image and on click of that image ...
0
votes
0answers
39 views
why controller as syntax not working in angular?
I am using new controller as syntax to remove $scope .But I am facing one problem while using ui.grid here is my code
http://plnkr.co/edit/ye0HXTbKv6dDYTQ0DMyX?p=preview
I am using this ui grid
...
0
votes
2answers
21 views
No-JavaScript or no-cookies-enabled browser
Assume that a user has JavaScript or cookies turned off in the mobile/desktop browser. Now, when a user comes to the site, the user should be re-directed to a specific page (e.g. some error page). How ...
2
votes
1answer
19 views
Meteor Angular & Request - How to bind?
I'm trying to finish the last phase of my script, which is displaying the response. I have a Meteor method that requests, through basic auth, an object from Zendesk's API. This method is called by ...
0
votes
1answer
38 views
angularjs: howto access directive (text) value
I want to write a directive that shows/hides the element based on the role I'm providing as a parameter (string value).
I have the following directive:
(function() {
'use strict';
angular
...
0
votes
0answers
32 views
Q:500 (Internal Server Error) at $http put?
I am trying to change a title to a string ("end" for example). This is my controller
.controller("changeTitleCtrl",function($http, $scope) {
$scope.setInEnd = function(value) {
...
0
votes
1answer
28 views
Refresh data on change in scope variable
I'm using AngularJS for an external web project.
I'm stuck with the update interval of the page as the JSON data I get is from the html div from inside the page, JSON data is being sent from policy.
...
-2
votes
0answers
12 views
How to call rest service if parameter (channelID) get change with Angular cacheFactory
myapp.controller('monthlyPlanController',['$base64', '$scope','$http','dthCache',function($base64,$scope,$http,dthCache){
$scope.loading = false;
//alert("Hello");
$scope.ripEcoSportPlus ...
0
votes
1answer
24 views
How to get i18n from different location with good performance?
Link for sample
Sample File
Here I created some sample application for locale..In that application
I created only few Json file in same location...one for English another one for ...
0
votes
0answers
17 views
How do I properly destroy a $resource object in AngularJS?
My controller EditCtrl is responsible for updating details of a project. The projectApi module has a $resource object, with all the required parameters. A variable named Project has been assigned to ...
1
vote
1answer
14 views
mapping the response to corresponding request
I am making $http request to multiple environment and processing after I get all the responses. I am using the code below:
$q.all(Object.keys($rootScope.envs).map(request)).then(function(res){
var ...
0
votes
1answer
22 views
Rails + Angular : Issue with directive
I have Rails 4.2.4 and Angular 1.4.8.
I am trying define a directive:
index.html:
<div ng-app='myApp' ng-controller='myController'>
<foo bar='bar'></foo>
</div>
...
0
votes
1answer
21 views
Type error:Cannot read property of undefined error generated in console
Type error:Cannot read property of undefined error generated in browser console error..I am trying to save the form with any information and it generates this error in the console.If i enter all the ...
1
vote
1answer
33 views
Access isolated scope in angular directive template
I am currently writing an angular directive that uses a template in a different HTML file and an isolated template. The directive gets some string via @ to its scope and that value is available in teh ...
1
vote
2answers
29 views
Update $scope doesn't affect the view
I am trying to update the $scope.loading from within the promise callback. I tried using $scope.$apply but I can't get it to work.
loading is a variable used in my view in order to show a loading bar ...
1
vote
2answers
27 views
Update data after display
In my Angular app I have an array of messages each of which has an array of pages on which it should be displayed:
[{
message: 'Foo',
showOnPage: [1, 3],
viewed: false
},{
message: ...
0
votes
1answer
27 views
Form is valid(ng-valid), even though one of it's input elements is invalid(ng-invalid)
I have a form as below
<ng-form name="TestForm" novalidate class="TestCls">
<div class="testValidation">
<input type="text" name="FirstName" ng-model="FirstName" ...
0
votes
2answers
26 views
How to use Attributes of a directive in ng-model of a html tag designed in the template using Angular JS
When I am trying to understand how to pull attributes and placing them in a directive, I found the following fiddler...
Here is the fiddler
Adding one more question for the above...If I want to ...