Tagged Questions
0
votes
3answers
16 views
AngularJS: attrs.$observe not firing after the first time
jsFiddle here
In the fiddle, if you click on the submit button for the first time, notice that the <input> correctly gets focused on. On subsequent clicks, the focus isn't set any longer.
I ...
0
votes
0answers
16 views
Angular UI-Router and simultaneous states
Say I have an angular web app that has 3 controllers (scopes) hanging of the root scope. I would like to use ui-state code and ui-view code to manage subviews within each of those controllers ( ...
1
vote
3answers
114 views
Passing data from one controller to other Angular
I have a controller which is fetching an XML file using $http and parsing it into a json object. This is 'MainCtrl'. Now I want to get the same json object in other controllers without again going ...
-2
votes
0answers
19 views
Angular: Confusion about select, validation, model
http://plnkr.co/edit/guhpukWsdZ6QHsKzlynZ
look to console
console.log($scope.myForm.foo) in $error.required = false
console.log($scope.myForm.foo.$error) = true
Some explain?
Thx
2
votes
1answer
21 views
add a custom function on angular $resource
I have an angular resource that goes something like this
app.factory('User', function ($resource) {
return $resource(
'/api/user/:listCtrl:id/:docCtrl/', {
id: '@id',
...
0
votes
1answer
19 views
Hierarchical Angularjs directives not retrieving scope variables
I'm building an AngularJS application. I use three directives to build the menu. The titles are inside a i18n file, so most of the attributes are angularjs expressions. Here is a snippet of how the ...
0
votes
1answer
33 views
View not updating on $scope.foo change
There are a couple of similar questions to the following one on SO. The ones I found have answers that are either out of date, wrong or do not solve my problem.
The following snippets are stripped ...
0
votes
2answers
22 views
AngularJS - setting focus to element using NON-ISOLATE directive
I know this question has been asked about 100 times (trust me, I've read them all), but I'm having trouble getting focus to go to an input box when the directive does NOT use isolate scope. The ...
1
vote
1answer
15 views
Object still up
I'm using Angular to display a table of users. I created a form to add and edit users. When a user row is clicked I'm passing that particular user to a function in my controller:
$scope.editUser = ...
0
votes
1answer
20 views
Where does model manipulation logic go in AngularJS?
I'm building an application that fetches calendar data via an AJAX call at the $rootScope. I use this object in various controllers, and I need to be able to parse it appropriately, as there are ...
1
vote
2answers
34 views
AngularJS: If you are not using a .(dot) in your models you are doing it wrong?
I remember seeing this famous quote from a video on AngularJS saying that should be always using a . (dot) in your models.
Well I am trying to follow this say I have
var item = {}
item.title ...
0
votes
1answer
59 views
AngularJS share asynchronous service data between controllers
I know this issue has been asked several times in stackoverflow, but I couldn't find a proper answer.
What I need to achieve is to be able to initiate some asynchronous call in one controller and ...
0
votes
1answer
17 views
.config .run and 2 x config, where to put changeroute .. appctrl, config, run or what?
I wanted to find out the different to .config and .run functions in angularjs. I was using my .config for setting up routes of course but i did have some $on for watching route change starts and ...
0
votes
1answer
29 views
Angularjs custom directive child scope access parent scope method?
I am trying to create a carousel with AngularJS ans UI Bootstrap. Since the carousel in UI bootstrap only supports images, I wan to write my own directive to support youtube video.
I want the video ...
0
votes
3answers
35 views
angularjs: $scope update when I change a select with jQuery
I'm using a jQuery plugin to 'customize' my selects.
This plugin fires the change event of the original select when some option is selected.
The problem is that my scope doesn't change.
Here you ...
1
vote
1answer
22 views
Angularjs $watch provides the latest input even when all the information was deleted
Have any way around this? Is there a better solution? Simulation: http://plnkr.co/edit/2vRT8O?p=preview
Context: In my case the inputs are used as filters, and the information entered by the user ...
0
votes
1answer
12 views
angular how to define multiple controllers
i have code like this
angular.module('mywidget', ['$scope']).controller('TestController', testController);
I want to add another controller to it ..say ...
0
votes
0answers
53 views
AngularJS - refresh view after http request, $rootScope.apply returns $digest already in progress
Hey guys so I am simply trying to load data when my app starts. However, the view loads faster than the http request(of course). I want to refresh my view once my data has been properly loaded because ...
0
votes
1answer
50 views
AngularJs: Applying scope changes from event firing
I have a directive which encapsulates a dialog box, and it's almost completely isolated from the surrounding scopes: the only way to communicate with/from it is by firing events. For instance, dialog ...
0
votes
1answer
23 views
AngularJS pass model to controller in live update
The two way binding in AngularJs is great in updating the view anytime the model changes. I was wondering if there was some way to pass the model to a function defined in the controller before being ...
1
vote
1answer
53 views
Model of a shared service isn't updating in AngularJS
Using AngularJS, I have two controllers that share the same service in my application.
When I fire an event that's controlled by the portalController function (see setLang()), I don't see the model of ...
0
votes
0answers
38 views
AngularJS - Share ngModel with nested directives and transcluded directives
I am trying to create 3 directives:
.directive('dirOne', function () {
return {
restrict: 'E',
transclude: true,
replace: true,
controller: function ($scope, ...
0
votes
1answer
26 views
nested function variables AngularJS?
Ok I have the folowwing:
function getRate(source, $scope, e) {
var dateValue = $("Date", source).text() || "";
if (!dateValue) {
...
0
votes
1answer
20 views
Weird Angularjs behavior with object into a service
I have a service that get an object defined into it.
app.factory('Store', function($http, $q){
var obj = {
data : [],
load:function(params){
var def = $q.defer();
var count = ...
3
votes
0answers
86 views
Update model from directive from $apply or $digest cycle in AngularJS
I try update model from directive and have some trouble when $apply or $digest already in progress. And I have some questions:
Why scope[attrs.ngModel] is exist, but ngModel.$modelValue isn't
exist ...
0
votes
1answer
43 views
Can you access a global javascript variable in an Angular expression?
Is there a way to access a global JavaScript variable in a Angular expression? such as:
ng-disabled="{someJavascriptVariableHere}"
0
votes
1answer
31 views
Independent scopes for similar controllers in Angular
I'm working on an app the uses multiple (but similar) controllers (controllerA) on a page and another controller (controllerB) that could change some properties, but ONLY if the element of controllerA ...
0
votes
2answers
33 views
Bitwise Angular Expression not working
I have a basic ng-show expression as follows:
ng-show="((message.status & messageStatus.Spam) != 0)"
However, this fails with the following msg: "Token '&' is unexpected, expecting [)] at ...
1
vote
2answers
33 views
Why does two way binding sometimes work without using a dot in Angular?
Consider this fiddle: Fiddle 1 When you select a date, you will notice that the text above it is not updating. This is because I had to use an object in my list, like this: Fiddle 2 (simplified).
...
0
votes
1answer
44 views
Double $rootScope in Angularjs app
This problem makes me a huge headache - I don't know why, but in my application i have two $rootScope, with $id "001" and "003" (each has separated variables). I checked ng-app occurrence and it's ...