Tagged Questions
0
votes
1answer
40 views
Update AngularJS Controller Scope from Another Controller/Scope
Hopefully this hasn't been asked.. I looked around and haven't found anything yet.
I have a single view that provides the user with a modal dialog (wizard) to create a few things and then save them. ...
0
votes
0answers
58 views
Angularjs Service Scope + Bindings
I am looking to run the following controller but im having trouble with scope.
I have a service that calls two functions that retrieve meta data to populate scope variables.
The issue is that ...
0
votes
2answers
29 views
Accessing $scope properties from inside a service in AngularJS
I am trying to create a constructor function inside an angular service, which I could then use inside of my different angular controllers. The problem is, my object generated from the constructor ...
2
votes
1answer
40 views
AngularJS: What is this directive doing?
I have a some experience with AngularJS and have come across this directive on the web, but it is not like anything I have seen before and I am unable to comprehend what it is doing? Can anyone help?
...
0
votes
0answers
26 views
Share data between directives
I'm rendering a large form that is described in a json file, in my view I'm using ng-repeat and then sending each element to a 'master' directive called FormRender, I have a controller in this ...
0
votes
1answer
10 views
Angularjs Error: registerService.getRegisterResponse is not a function
Error: registerService.getRegisterResponse is not a function
I getting Above Error on console of the web browser. While Accessing the a method(i.e saveRegisterResponse()) from Controller (i.e ...
1
vote
1answer
48 views
Getting variable from socket.io in AngularJS
Basically i have two sources of data, one is real time data from socket.io and other is json object. And i'm using both in front-end but the problem is that i need to pass a variable from socket.io to ...
0
votes
1answer
33 views
Directive with isolate scope property on ngSelect element to pre-select option: It randomly loses value
It looks like this. I load my page and my form displays with values fetched. These values are being fetched by an http service. At the top of the form there is my custom directive (select box):
...
0
votes
0answers
42 views
Workout on restful services for single page applications
I am just a beginner in Angularjs. I have been trying for consuming WebApi service by angularjs. I am following this
1: ...
1
vote
1answer
80 views
What is the difference between `value` attribute and `ng-value` attributes in angularjs
What is the difference between value and ng-value attributes in angularjs templates? If I use ng-if on the field using value attribute it works properly but if I change the attribute value to ng-value ...
1
vote
1answer
53 views
How to add dynamic fields with angularjs
I am working on a QA app where i need to add multiple answers to a question as per requirement dynamically. for this in my form I have a question field , an answer field and a Boolean correct field to ...
0
votes
0answers
40 views
How to handle many to many relationships with Angularjs' $scope variable
I have two services that hold my two objects which have a many to many relationship; Missions (or steps/actions) and the Tools needed for these Missions. Each Mission can use many tools and each Tool ...
0
votes
1answer
90 views
Angularjs select with ng-options calling a function?
here is my html
<select ng-model="selectedMarker" ng-options="shape.text for shape in Selects('shapes')">
</select>
and the code
angular.module('todo', ['ionic'])
...
0
votes
2answers
58 views
ngTable custom refresh action?
I have a table showing data from a remote server. There is a numeric input, when the number is changed I want the table to be refreshed (with the numeric input in arg).
Here is my current attempt:
...
0
votes
0answers
21 views
Angular location change resetting browser history
I'm watching for a change on $locationChangeStart, if the user is on Step2, and they try to go to Step1 via the browser back button, I have successfully interrupted this, displayed an alert, and will ...
0
votes
0answers
27 views
How to lazy load panel content on a button click having multiple panels on the same page using angularjs
I have a scenario here where I have multiple panels (using ng-repeat) on the same page. Each panel have a link, on click of which it loads data specific to that particular panel and returned response ...
0
votes
2answers
43 views
How do I populate a scope with a http response?
The problem I have is that on page load the response from the API takes a while and my view (scope) is empty. But when I switch view back and forth the groups-view (scope) is updated with the object ...
0
votes
1answer
34 views
How to share data and calculations across multiple controllers in Angular?
This is my first project using AngularJS and, unfortunately, it isn't exactly a gentle introduction. I have had to "hit the ground running" so to speak.
I am tasked with building a customizable ...
0
votes
1answer
109 views
AngularJS controller scope won't sync with promise
I've picked up a project and I'm trying to return some data from a service to my controller. I've been at this for about 12 hours, and have tried different methods. They all usually result in this ...
0
votes
1answer
35 views
angularjs scope two values keeping pointing to each other
Hi I'm trying to copy a scope value from one to another scope. For example:
var items=$scope.order.invoicewindow.items;
$scope.order.orderwindow.items=items;
However right both scopes are ...
0
votes
4answers
130 views
angularjs maintain the scope variable across routes
How do I maintain the model across routes. for eg I have a list of profiles loaded onto the home page. The home page also contains a "load more" action to load more profiles, basically pushing data to ...
0
votes
1answer
57 views
angularjs service scope issue after directive event listener callback
I am trying to use an event listener in my angular directive along with a service.
I am having a scope issue as I want 'this' to refer to my service's 'this'.
Right now, in my service, 'this' ...
0
votes
1answer
67 views
Inserting a directive from another directive's compile function
I want to dynamically insert the <confirmation> element in the DOM from the updater directive. (I have it setup to tap into an event, which it does in my real app) I just need that element ...
0
votes
2answers
67 views
AngularJS for loop not waiting for modifications to $scope
I've been wracking my brain over this for a few days, so I figured it's time to finally ask somebody who actually knows what they're doing. ;)
I'm building an AngularJS app and getting an odd ...
0
votes
1answer
25 views
AngularJS: function always evaluates to false because of Async nature of service
My Template looks like
<div data-ng-if="budgetSummaryExists()">
<span>You have not budget</span>
<button type="button" class="btn btn-danger"
...
1
vote
2answers
50 views
AngularJS: Recommendation on rendering different view when HTTP 404
What I am doing
I am trying to create a service which loads the user budgets for current month. The code looks like
$scope.thisMonthBudgetSummary = function () {
console.log('retrieving ...
0
votes
1answer
30 views
How to check for errors in resolve using angularjs?
Im using a resolve in ui-router and a promise in my controller, but cant figure out how to check if a 422 / 500 error is returned and show a different message.
here is my code:
.state('rated', {
...
0
votes
0answers
32 views
AngularJS remembering page scroll location
I have multiple pages of data that lists publications by author. The first page lists all the publications and has infinity-scrolling implemented.
Another page allows you to filter by author, and ...
0
votes
1answer
146 views
angularjs - Watching service properties in a controller scope… changing them from a directive… no update?
Let's say I have a very simple service with a few properties on it. If I use the service in a controller, put the service's properties on the scope so that they are bound to my view, and update them ...
0
votes
2answers
145 views
AngularJs ngShow triggers double in controller
I have a problem with the controller triggering the method defined on the $scope twice when the page first loads and when the form submits.
Here's the fiddle : http://jsfiddle.net/scabro/pQb6q/5/
...
1
vote
1answer
208 views
How can I download a file using AngularJS?
I want to list all the files(from a directory) in the view. When I click anyone of them. Then the corresponding file must be downloaded.
Note: I am working in a windows machine.
I have the following ...
0
votes
1answer
229 views
AngularJS - mechanics of $scope.$watch - is it just an observer pattern?
I have some factory:
.factory("someFactory", function() {
var someFactory = {};
someFactory.objects = [
{ name: "obj1" },
{ name: "obj2" }
];
return someFactory;
}
And some ...
0
votes
4answers
216 views
How to display JSON list data in angularjs
I am new to Angularjs and having trouble displaying data . i.e. Json array
This is the result of my rest service call:
...
0
votes
0answers
16 views
Is service dependency mandator if implementation enviroment contains the dependency (I.E controller has dependency)
Is a dependency added to service when it will be used in a controller with the dependency already injected.
The service :
myServices.factory('firebaseWritejournalUser',['',function() {
...
7
votes
2answers
2k views
AngularJS, is this way of using service good?
i've this HTML:
<p>Hello {{name}}</p>
and the controller is:
function myCtrl(scope, service) {
scope.name = service.getUsername(); // service.getUsername() return "World!"
}
...
0
votes
0answers
27 views
Share one function in one service to the second service in angular js
I have a module in AngularJS. I have two controllers (app.factory) who help to the module in validations etc.
I have one function of validation in controller 1 and i need it also in controller 2.
...
1
vote
2answers
3k views
AngularJS: open a new browser window, yet still retain scope and controller, and services
I'm writing an angularJS app. In this particular controller, I open a new browser window through the $window.open service. But in the new window, all the $scope variables are lost.
I tried to use ...
0
votes
1answer
48 views
Capturing response on failure in angular js?
I am novice and working on angular for first time.I am calling one service in angular. When the call is successful it gives me the response like User name and his log in information. When call is fail ...
0
votes
1answer
18 views
it's right this service AngularJS
My service don't work. I am not sure if it's right or not.
I want The service to add items when the app runs , and their other function it's for add another textbox, but the million question is the ...
2
votes
3answers
65 views
unable to get data from $q into scope
I'm trying to bind some data being returned from an API to my scope using promises with $q, I am able to pull the data from the server without any issue (I can see JSON being returned using fiddler) ...
0
votes
1answer
59 views
angularjs directive isolated scope within link method
My jsbin is here: http://jsbin.com/yapi/1/edit
I am testing the isolated scope within link method of the directive (it works when used within template instead).
My goal is that link method in ...
1
vote
2answers
346 views
Access stored data in an Angular factory after a $http call
I am trying to build a factory to act as a staging area for my database models, as well as an api to perform basic CRUD calls. I want to be able to access data by storing it in a service or a factory, ...
1
vote
1answer
87 views
Service vs Inheritance for Access Parameters Outside `ng-view`
Is it more effective to use a Service or rely on Scope Inheritance when updating parameters outside an AngularJS ng-view?
I have an AngularJS page with an ng-view and a common header. When moving ...
0
votes
1answer
113 views
AngularJS remove $rootScope from a service
I have a service wrapped around WebSocket, I wanted to do it with promises and coupling requests with responses, here is what I came up with:
(function () {
var app = angular.module('mainModule');
...
3
votes
2answers
307 views
Single page app, permalinks and ngView?
This is my current setup, with each column being represented by a controller:
<navbar></navbar>
[column1] [column2] [column3]
<footer></footer>
Additionally each column has ...
0
votes
1answer
84 views
How do I properly set a service property from model data in a controller in angularjs?
I've set up a service to share some data/state between multiple controllers. In one controller, I update some of the service properties with scope data through a save function. That data is then used ...
1
vote
2answers
340 views
AngularJS creating (and binding) form elements dynamically based on API response
I'm trying to create a member's form with all the pre-defined phone types.
I'm making two api requests for member and phone types. Here is what I've:
First request with member's information:
...
0
votes
2answers
53 views
AngularJS Services - using in Controller
I'm building a pretty simple app where I have a GlobalController (on body element), and will have another sub-controller below. This is a templated site with multiple, physical pages such that the ...
1
vote
1answer
2k views
AngularJS Bind service array variable to controller scope
I have been able to properly bind an object with primitive data from a service to a scope variable from a controller but I'm having trouble doing the same thing with an array variable from the ...
2
votes
1answer
3k views
AngularJS not updating template variable when scope changes
This will be one of those stupid questions that is very obvious to the experts.
I have a websocket pushing data to a service where I'm trying to store the data and have it pushed to a template via my ...