Tagged Questions
0
votes
2answers
96 views
AngularJS: How to pass values from Controller to Service Method?
I have a controller which is dependent on a TransactionService. One of the method is
$scope.thisMonthTransactions = function () {
$scope.resetTransactions();
var today = new Date();
...
3
votes
1answer
76 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
3answers
76 views
$watch not working on variable from other controller?
I have one controller which displays a checklist, and stores the selection in an array.
My other controller runs an $http.get on the array from the first controller.
How do I set a $watch so that ...
0
votes
1answer
41 views
Understanding $watch in AngularJS? [duplicate]
I am a little confused with the $watch syntax in AngularJS.
Given a variable $scope.foo, with initial value of [1,2,3], and update causes it to now equal [1,2]. I want a function to be run whenever ...
0
votes
1answer
30 views
AngularJS deferred specific behavior inside the scope
Assume that we have a bit of html like that:
<button
id="my-login-button"
ng-hide="loggedIn"
ng-click="login()">Log me in!</button>
Also we have a JavaScript:
// controller.js
...
1
vote
2answers
123 views
AngularJS: PUT send data with URL but not as JSON data
Here is my UserService
angular.module('userServices', ['ngResource']).factory('User', function($resource) {
return $resource('/users/:userId',
// todo: default user for now, change it
...
0
votes
1answer
100 views
AngularJS: service query returning zero result
my app.js looks like
var app = angular.module('pennytracker', [
'$strap.directives',
'ngCookies',
'categoryServices'
]);
app.config(function($routeProvider) {
console.log('configuring ...
1
vote
1answer
165 views
AngularJS memory leak with ng-switch? Can someone solve this?
I've built a custom routing method for angularjs and I use this to control ng-switch within my app in order to create multi level deep linking.
http://plnkr.co/edit/beAm3WRomMafKzx1SoSZ?p=preview
...
0
votes
1answer
181 views
Angular: call service once multiple controllers
This should be a fairly straight forward question, but I'm stumped.
I have a service that makes an http call and then does extensive post-processing of the results. I would like the processed ...
2
votes
1answer
71 views
AngularJS - resource - doas a request have to be inside $scope.$apply?
I could not find anything in the docs about this, but it seems that any request has to be inside a $apply() call - (wether this $apply() call comes from an action or is invoked manually).
I can not ...
2
votes
1answer
299 views
AngularJS controller/service/http communication
I've wrapped up my REST API in an AnguarJS service that gets injected into controllers. Pretty standard, right. Now I'd like that service to intercept any 401 response and somehow trigger a logout or ...
1
vote
1answer
114 views
AngularJS - AlertFactory open dialog behavior
i'm creating an AlertFactory because ui.bootstrap.dialog doesn't works in my app.
So i type follow code: http://jsfiddle.net/Premier/BHqKB/17/
enter code here
It works very well if you click on ...
1
vote
1answer
192 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!"
}
...