Tagged Questions
0
votes
1answer
20 views
Trouble iterating, and parsing application data
I am working on my first AngularJS web-app and have been stuck trying to iterate and parse some data. I am trying to display how many users (and ideally their name) are currently connected to my ...
1
vote
1answer
22 views
AngularJS directive link function not being called
I am trying to use angular-http-auth library with bootstrap modal window. Modals are working fine but I have problems with directives.
Here is a jsfiddle link - http://jsfiddle.net/jCUSh/85/ . I am ...
0
votes
1answer
17 views
Angularjs : accessing service methods from directive's link function
i have a directive, and in its link function i want to access methods from a service. My code for directive is
AppDirectives.directive('feed',['FeedService',function() {
return {
restrict : 'AE',
...
0
votes
1answer
34 views
AngularJS Modules/Scope Sharing
I recently started using AngularJS and the way I'm building my apps now is like this:
MainController.js
var app = angular.module('app', ['SomeController', 'MainController']);
...
0
votes
0answers
58 views
What is “as” in Controller's expression in AngularJS?
The example in Filter Angular Guide has Controller expression with "as", which I could not see documented there:
<div ng-controller="FilterController as ctrl">
What is the meaning of this ...
0
votes
2answers
40 views
How to access the value of one controller from another controller in angularjs
I have two controller in an angularApp with following codes
Controller:Devicectr
function Devicectr($scope, $http) {
$scope.Devices = [{ Id: 1, Devicename: "MasterDeviceA" },
{ Id: 1, ...
1
vote
3answers
63 views
AngularJS: ng-repeat with dynamic data
I'm building a simple AngularJS app, but I couldn't solve a problem regarding services, ng-repeat and dynamically added data.
What I'm trying to do
My page is splitted into few countrollers.
In the ...
1
vote
1answer
18 views
How to update scope model after operating the filters?
I'm trying to update the scope model ($scope.itemsCount) after operating the filters. Please have a look at my demo code which is similar to my original functionality.
Plnkr: ...
1
vote
0answers
27 views
adding more than one sources of data to angular
this is what I have in my model
// The contents of individual model .js files will be concatenated into dist/models.js
(function() {
// Protects views where angular is not loaded from errors
if ( ...
1
vote
2answers
52 views
Angular js directive and repeater issue
i have this piece of code here
var app = angular.module('app', ['ngRoute'])
.directive('loadObject', function (repository, $rootScope) {
return {
scope: {
loadObject: '@'
...
0
votes
0answers
27 views
Display data bound from a Controller in a modal with AngularJS?
I am simply trying to display data in a bootstrap modal once a button is clicked however the data is just not showing.
Controller:
var MainCtrl = function ($scope) {
$scope.vlad = {};
...
0
votes
2answers
57 views
How to get the length of a div in angularjs on click?
This is really basic but I don't know why I'm not able to solve this problem.
I'm trying to get the length of a div when I click on it, I've tried different ways to do that but with no success at ...
0
votes
1answer
42 views
AngularJs : Passing parameter to ng-click in directive
I have a directive in which i am adding an a button and an ng-click on the button. My code for directive is
AppDirectives.directive(
'feed',
function() {
...
0
votes
3answers
30 views
How do I change a variable in MainController from PartialController? (angularjs)
I have a partial view that is using angular. How do I change a variable in the MainController from PartialController? I am not sure how to create the interdependence...
...
0
votes
1answer
26 views
AngularJS ng-model in template passed to directive controller
I've got a directive with a controller, that builds a form for posting comments to an API via CommentsService
My directive looks a bit lik this:
app.directive('appComments', function( CommentService ...
0
votes
1answer
51 views
How to update angular scope
i want to make some changes in my controller of the data i get from the server. I made an example of these to explain my problem. The recursive method "update" seems not to update the value of the ...
0
votes
0answers
31 views
Difference between template and templateUrl in angular js directive in isolated scope
I have a directive in isolated scope and i define a couple of variables in link function of the directives so the template fails to bind to these variables but templateUrl seems to bind to these ...
0
votes
1answer
30 views
Unable to call locally declared scope function via ng-click in a directive
I have a directive (Just a button).
This directive has an isolated scope.
I want to update the object in my parent scope by clicking on the button.
But the function is not being called.
This is the ...
0
votes
1answer
21 views
Dynamic ng-model binding inside a directive
I'm trying to create a custom component that uses a dynamic ng-model inside-out the directive.
As an example, I could invoke different components like:
<custom-dir ...
0
votes
2answers
44 views
AngularJS. How to get values from lists? Not using ng-repeat nor radio-buttons
I am trying to find a solution for the submitting a value to the scope. I use AngularJS 1.2.5 and Twitter Bootstrap 3. I have created the pluker here ...
0
votes
3answers
31 views
Call controller function when directive attribute changed
My code so far:
.directive('ngSpreadsheet', function () {
return {
restrict: 'EA',
scope: {
curpart: '='
},
template: '<div ...
1
vote
2answers
33 views
Angularjs Sharing controller between directive
While implementing angularjs directive i have got some issues in sharing controller between directive
i cant access the enterUser directive from the below controller
app.directive('entires', ...
0
votes
3answers
84 views
Exporting methods from an angular factory or directive to use later
I have developed a web application using Angular.js (It's my first). The application features a collection of interactive graphics (seat maps); so I created a module to handle the Raphael stuff, ...
1
vote
1answer
30 views
Rendering directives within $sce.trustAsHtml
I've included a Plunker here: http://plnkr.co/edit/4vqV8toHo0vNjtfICtzI?p=preview
I'm trying to add a button to the DOM and when clicked should execute the function bound to it. In this case it ...
3
votes
2answers
76 views
How can I retrieve only visible field values in Angularjs? Hidden/Removed fields persist in scope
If I hide (ngHide/ngShow) or remove (ngIf, filter) a data-bound form field, the value persists in the model.
This is useful if the field is later shown/added because it keeps the value, however I ...
0
votes
1answer
47 views
AngularJS - Calling a controller function from a service
I'm so green at Angular, I'm not even sure I've been structuring a search for this correctly. The whole directive and service terminology is still confusing me some, but that isn't my question.
I've ...
0
votes
1answer
25 views
Angularjs call synchronization
I am using angularjs get method to get array of feeds from server. here is my controller code.
$scope.feeds = new Array();
$scope.feeds = FeedService.getFeeds();
console.debug("in controller ...
0
votes
0answers
18 views
Isolated scopes for multiple dialogs in AngularJS
I have a dialog box where i display a list of results.
I open the dialog box like this:
var dialog = $modal.open({
windowClass: "leaf-data in",
...
0
votes
1answer
39 views
How to stop propagation of & functions into nested directives
here I got one ctrl
controllers.ctrl = function($scope){
$scope.trData = [
{name : 'elem1',children : []},
{name : 'elem2',children :
[{name : 'elem3',children : []}]
}
};
...
1
vote
2answers
42 views
angularjs ng-repeat doesn't process linebreaks
Hi I'm building a chatapp in angularjs and my autoscroll scrolls all the way down to the bottom of the chat box like it should when there are no linebreaks in the message. However, when there are ...
0
votes
3answers
41 views
How do I update an angularjs page after a scope update?
I have written a directive that captures keyboard events, and on certain keys I update some objects in the scope. The idea is to move up and down an array and display the selected row details. The ...
0
votes
2answers
65 views
AngularJS mathematical calculations with ng-model, ng-click buttons, outputting the results in web app
I'm starting with AngularJS, learning it bit by bit. For several days now, I am trying to understand how to calculate between ng-models (scopes) in a web-application.
Here is what I am trying to ...
1
vote
1answer
33 views
Assignment in an expression
I'm trying to make a directive which receives expression as a callback to bootstrap's 'hidden.bs.modal' event:
//the use
<div class="modal" modal-on-hide="currPane = 'firstPanel'">
//the ...
0
votes
1answer
48 views
Access controller method from AngularUI bootstrap modal popup
I am using the AngularUI bootstrap modal popup. I am loading an aspx file into the popup by using 'iframe'. Here is the code for my popup template:
<script type="text/ng-template" ...
0
votes
1answer
47 views
Understanding ng-show in AngularJS directives
Given the following code:
http://jsbin.com/uYETOSUM/2/edit?html,js,output
I want to only show the first dropdown first (parent question in JSON). After user have selected an option I want to show ...
0
votes
1answer
30 views
Scope property doesn't update until page refresh
I'm using resource in a factory to authenticate a user. I set $scope.user = User.user in my controller and print out user.username in my view. This all works like a champ except that I don't see the ...
2
votes
1answer
25 views
Storing generic controller function in services in order to get them in isolated scope
I have an Angular UI modal that I would like to use the following method on, I used to keep it on the controller that wraps my entire application(metaCtrl), but the modal seems to create his own ...
2
votes
1answer
33 views
angularJS directive with isolated scope, attribute binding doesn't work
Please see this jsfiddle: http://jsfiddle.net/viro/DK5pC/3/
What I did looks right compared to the tutorials and replies I've found, so I'm sure I'm overlooking something trivial.
I'm trying to do a ...
1
vote
1answer
28 views
correct way to initialise scope values when the view is loaded with angularjs, ngInit?
I've been learning angularJs for the past few weeks and been looking at a number of large scale apps to see how things work in the real world. In most of them I have noticed when a view is loaded :
...
3
votes
1answer
49 views
How to Dynamically add Direcitves angularjs
I have successfully Added an angularjs directive into another directive using this code
var newElement = $compile( "<div my-diretive='n'></div>" )( $scope );
$element.parent().append( ...
0
votes
1answer
26 views
AngularJS hardcode checkbox filter
I've a tricky question.
How can I filter a scrope with multiple checkbox ?
This is my scope :
function UserListCtrl($scope, $filter) {
$scope.users ...
0
votes
1answer
39 views
Angular Parent & Child Scope doesn't work in $root scope?
I found two examples about parent & child scope inheritance. However, 1st one is using parent and child controller, while 2nd example is using root scope. But 2nd example doesn't work as expected. ...
0
votes
0answers
48 views
Angular $scope variable is not updating after processing data via angular service
I'm developing an AngularJs application that fetches via Angular Resource.
I receive the array of data just fine, and view the records inside a table view via ng-repeat and everything works great.
...
0
votes
1answer
25 views
AngularJS ng-disabled directive with expression is not working
User Story: When a new user clicks the New User checkbox and accepts the TermsAndConditions radio button, the Register button should be enabled.
My code in angularJS isn't working. The Register ...
0
votes
1answer
66 views
Angular JS how to watch “Only One Property”
I have an array of objects with multiple editable properties.
** Update
For example the object
var objA = {
propA:'vala',
propB:'valb',
propC:'valc',
propD:'vald'
}
and array
var a1 ...
0
votes
1answer
46 views
Angular js factory and injecting factory in normal javascript to make it modular
I have created a factory to invoke Rest services using $resource. The factory function is used multiple places in my code and is based on the usage I need to use for different callbacks. I want to ...
2
votes
1answer
19 views
Angular scopes and losing binding
I haven't been able to find anywhere else that really helps me understand my Angular problem here but I suspect it has something to do with inheritance that I haven't completely grasped yet.
I'm ...
0
votes
1answer
40 views
AngularJS - Select, set default values for Edit/New
First project working with AngularJS and I am a bit stuck using the select list to either set the default value to the first option for a new, or if its an edit select the value.
I have a form with ...
0
votes
2answers
38 views
Angular: Applying results from a factory service to a scope controller
I am writing an UploadService.
The upload so far works fine.
But I'd like to update the scope of the controller with the xhr callbacks, in order to display relevant information and UI.
How would I ...
0
votes
1answer
34 views
How to clear events when manually bootstraping ng-grid in an Angularjs Single Page application
I'm working on an hybrid SPA with many angularJS modules in an existing application.
When manually Bootstraping ng-grid twice or more, 'ngGridEventStartCellEdit' events are multiplied each times the ...