Tagged Questions
0
votes
1answer
11 views
Update $scope when contenteditable Elements Change with Angular.js
I am new to Angular.js and have tried to follow several tutorials to learn how to two-way bind contenteditable elements in an ng-repeat.
I am using a shared 'store' between controllers, e.g.
...
1
vote
2answers
22 views
Angular $http get works in browser but not on device - Ionic
I have a factory returning an object calling an internal resource containing JSON as so:
.factory('cardFactory', function ($q, $http) {
return {
getOtherStuff: function () {
var deferred ...
0
votes
1answer
15 views
Calling service method from a directive template
Let's say I have a directive:
<component>
<img ng-src='{{something}}' />
</component>
defined as:
app.directive("component", function() {
return {
scope: {},
...
0
votes
0answers
15 views
cascading dropdown filters with ng-table
I'm trying to get filter support on ngTable with two external cascading dropdowns. as the documentation shows i have updated filterOptions but seems no luck. please help me
$scope.tblInventory = ...
1
vote
2answers
29 views
why header come down when constant or fixed button add .?
I have one button which should be remain contant or fixed in same position in all views .But when I added a view , its header comes down below the button
why ?
when I remove this ...
0
votes
2answers
25 views
AngularJS .00 currency filter
I have used the .00 currency filter from: AngularJS currency filter: can I remove the .00 if there are no cents in the amount?
However, how can i adapt the filter to split the value by comma's?
For ...
1
vote
1answer
24 views
Accessing directive scope from a separate controller
Let's say i have a <lightbox> directive in AngularJS. The lighbox has two params: title and image_source, which in turn are referenced in its HTML with {{title}} and {{image_source}}.
Because I ...
0
votes
0answers
13 views
How to correct child scope (ng-include) issue inside controller
I have a form like below where i am loading an external template (sample.html) using ng-include ,
<div>
<form class="form-horizontal" ng-include src="'/src/sample.html'"></form>
...
0
votes
1answer
33 views
asynchronous callback returns null
I am trying to assign callback function values and display ng-repeat
var myApp = angular.module('mybet',[]);
myApp.controller('MyBetController', ...
1
vote
2answers
21 views
$scope update across different modules on $http
How do I update one module's $scope member from another module's $http.success()?
This is going to be a tough one to explain, so I'll do my best.
I have two modules, HeaderApp and ContentApp. ...
0
votes
1answer
21 views
AngularJS, inconsistencies when assigning versus updating scope within the transcluded content of a directive's isolated scope
JSBin Example:
http://jsbin.com/yuyetakonowu/1/edit?html,js,output
Summary:
I have two directive's (myParentDirective and myChildDirective). myParentDirective transcludes myChildDirective content. I ...
0
votes
0answers
14 views
ng-minlength in directive not populated when invalid
I'm creating an input directive that encapsulates a label, and some error messaging but I'm getting stuck with ng-minlength and ng-maxlength. The issue is that they don't populate the model value ...
0
votes
0answers
33 views
Why is my model only updating if it is attached to an object? Angular
I am trying to update a model with some radio buttons. I have 2 different set of radio buttons and I can access only one of the updated models from the controller. Here is my html:
<ul>
...
0
votes
1answer
15 views
Angular get dynamic variable from $scope inside ng-repeat
I'm unable to output a variable within my $scope inside an ng-repeat
The following variables are defined inside my $scope: error_question1 , error_question2 , error_question3
I have the below ...
0
votes
0answers
17 views
validation with dynamic name in ng-repeat
Im currently having an issue where I want to create multiple form inputs with validation. The form elements I want to
create will be up to 100 duplicated fields. To do this I have used ng-repeat as ...
0
votes
1answer
27 views
Scope variable reference to service data AngularJS
I have a service with an object, and that object has a property value, and I set this to reference to a scope value of a controller. Why when I update scope value, services value is not updated, or ...
-1
votes
3answers
31 views
Angular two way data binding not working
Thank you all guys. I will now select one detailed answer and close this up.
see the code below, it's fairly straight forward
<tr ng-repeat="record in records track by record.id">
...
0
votes
0answers
37 views
how to make tab bar in angular js with sliding effect?
how to make tab bar or navigation bar in angular with sliding effect .I am able to make in jquerry mobile .Here is my fiddle
http://jsfiddle.net/ezanker/o9foej5L/1/
when I used same thing in angular ...
0
votes
4answers
40 views
update scopes in multiple controllers after $http
I'm struggling to figure out how to do this. Hope anyone can help :)
I have multiple controllers in my Angular app. Like titleCtrl and SettingsCtrl
I have a service which holds a variable like this:
...
0
votes
0answers
26 views
How to send data back to angularJS controller when full data is not fetched yet [on hold]
I have one logical question and the scenario is:
I am using AngularJS and Spring 3.
When user click on say "show all results", from controller to service and a rest call to spring controller is ...
0
votes
1answer
54 views
Sharing non-singleton state between controllers ( Angular Architecture )
In my current company we are working on a very large angular application. One of the points of constant contention is to figure out what is the best way to share non-singleton state between ...
2
votes
0answers
29 views
Ways to send $scope to be used into prototype functions
I'm trying to figure out ways to let the $scope available to access from my prototype methods:
Sending $scope as a parameter:
var myController = function($scope, Service) {
$scope.myMethod = ...
0
votes
2answers
23 views
difference between init function calling from controller initialization and from html page at rendering in angular js
what is the difference between init() method calling from controller initialization time and from html page at rendering in angular js ?
html partial:
<div ng-init="init()">
---
---
...
3
votes
2answers
30 views
How should prevent the changes affect in more than one model angularjs?
namespace.aaa=response;
namespace.bbb=response;
response is the data coming from service. I just assigned them to two models(aaa,bbb). Then assigned model (namespace.aaa) to a grid. If I ...
0
votes
3answers
48 views
My li scope not remove in angular js Why?
Hi Please Help me i m new in angular js
i just create a function.
i m repeat the content .
i create a function who is add next tab section and remove this section.
i create a same function to ...
0
votes
3answers
21 views
Correct way to update scope value in angularjs view
View code
<a ng-click="deleteOrdersUpdate()">Update</a>
<span class="red">{{noOfOrders}}</span>
Controller code
$scope.deleteOrdersUpdate=function () {
...
0
votes
1answer
16 views
Generating proper options for select using ng-options
Trying to get the options in the select field to use the IDs in an array as values.
HTML looks like this:
<select class="form-control" name="activitySelector"
ng-model="item"
...
0
votes
2answers
21 views
Is there a way to know the name of the model used in a directive?
Suppose I have the following directive:
.directive("counter", function () {
return {
restrict: "E",
scope:{
bindModel:'=ngModel'
...
0
votes
1answer
26 views
Angular Directive variable not getting sent back to rootscope
I have a file upload angular directive that works WHEN NOT placed inside of a tabset.
In the code below you will see that after a file is selected, and uploaded, it sets
scope.$parent.file = file;
...
0
votes
1answer
20 views
Pass Model to Controller to Change in Controller
Here is my situation, I have this HTML:
<input type="text" ng-model="inputModel" />
<div class="button-container">
<button type="button" ...
0
votes
2answers
17 views
AngularJS trouble calling nested scope
So I'm playing around with AngularJS and wants to make two separate lists of skills. On list for my development skills and one for my design skills.
Problem is that I my data from the development ...
0
votes
1answer
16 views
Design suggestion for Add / Edit scenario in Angularjs
Here is my scenario. I have a addPersonController and editPersonController with addPersonView and editPersonView respectively. In both controller, I am uploading the Person's picture. My upload ...
0
votes
1answer
45 views
Understanding $scope mechanics in Angularjs
I can't clarify for myself how to deal with $scope in Angularjs. Although I've resolved my current issue other way, still I need help to get comprehension of $scope usage.
I have the following form ...
1
vote
1answer
21 views
AngularJS directive not inserting values into template when using an isolated scope
Given the following directive:
angular.module('news.directives', [])
.directive('newsArticle', function($location, $timeout) {
return {
restrict: 'AE',
replace: ...
-1
votes
2answers
19 views
How can I take data from an external controller into a directive template?
I have a factory who provide data to a controller but when I call from the directive the data do not bind.
myApp.directive('user',function(){
return{
replace:true,
restrict:'E',
...
0
votes
2answers
21 views
AngularJS - Accessing var in a service which are defined in a controller
I have an angular controller which have a number of variables decalred. I am trying to access these in my angular service:
app.controller("MyController", function($scope, myService) {
var ...
0
votes
0answers
23 views
Render directive in parent controller defined in child controller
Basically i would like to achieve something along the lines of this:
<div ng-controller="ParentController as parent">
<render-page-controls></render-page-controls>
<div ...
0
votes
1answer
19 views
how does my-pane directive's scope get access to selected property in this example
In this official example, in section "Creating Directives that Communicate", in file my-pane.html, ng-show='selected' is used for determining whether the content is to be hidden or not.
My question ...
0
votes
1answer
18 views
Calculating date difference with angular filter
I needed to be able to calculate the difference between two days, inclusive, and display the difference. Ideally this would be via an angular filter so it can be used all over the application.
1
vote
1answer
62 views
AngularJS ng-model not working on dynamically created input fields
I've created a dynamic templateUrl for form fields and I'm trying to attach ng-model within ng-repeat. The parent directives and form field directive all work and are generated, but when I use ...
0
votes
1answer
55 views
$watch is not called, Angularjs
I have a problem with $scope.$watch call, when it obviously should be called.
I have a paginator (bootstrap UI) inside my html document:
<pagination total-items="paginatorTotalItems" ...
-1
votes
0answers
29 views
ngClick functions not used in ngSwitch
I have a directive that uses ng-switch to show/append different html depending on the scope value, and in case that the ng-switch is true, we show a button, that has an ng-click directive. The ngClick ...
-3
votes
2answers
55 views
Use scope variable and dynamic css in ngClass
I would like to use a scope variable and and set css dynamically within html.
<div ng-class="myClassScope, { 'dynamic-class': !ifIsNot }">
0
votes
3answers
424 views
Angular - ng-repeat filter when value is greater than
I have a simple ng-repeat that throws out data, one of fields it displays is NumberOfStamps:
<tr ng-repeat-start="list in Data.Items ">
<td><a href=" {[{list.Title}]} ...
-3
votes
1answer
46 views
Extend Directives Scope AngularJS
I have two directives, that use the same function, depending on manipulating the view and the data.
scope.hide()
scope.show()
...
Currently I am writing a service, but services are mostly for data. ...
10
votes
3answers
11k views
AngularJs: Reload page
<a ng-href="#" class="navbar-brand" title="home" data-translate>PORTAL_NAME</a>
I want to reload a page.How can add to do this?
42
votes
3answers
11k views
$watch an object in angular
I'm pretty sure i'm missing something very simple here.
I want to watch for changes in a dictionary, but for some reason watch callback is not called.
Here is a controller that I use:
function ...
33
votes
2answers
14k views
Directive isolate scope with ng-repeat scope
I have a directive with an isolate-scope (so that I can reuse the directive in other places), and when I use this directive with an ng-repeat, it fails to work.
I have read all the documentation and ...
18
votes
5answers
12k views
Binding inputs to an array of primitives using ngRepeat => uneditable inputs
Here is a demo to my problem.
$scope.myNumbers = [10, 20, 30];
<div ng-repeat="num in myNumbers">
<input type="text" ng-model="num">
<div>current scope: ...
7
votes
1answer
11k views
Why is ngModel.$setViewValue(…) not working from
I'm writing an directive which needs an isolated scope, but I want to bind it to the parent scope via ngModel.
Here the problem is that the parent's scope value is not getting changed.
Markup
...