[AngularJS] Re: live chart data via REST API request

2014-05-15 Thread pwldp
Hi,
maybe this example: https://github.com/pwldp/exp-ang-sio will be useful for 
you.


W dniu czwartek, 8 maja 2014 04:07:39 UTC+2 użytkownik Neil Camara napisał:

 Hi folks,

 I currently have a chart and I click a button to fetch newer data via a 
 REST API call, GET method. Now, the bosses would like to see almost live 
 chart. With my limited knowledge in AngularJS, the first thing that came 
 into my mind was to do polling by doing GET request every n seconds. 
 However, I would like to implement the best solution.

 Any help would be greatly appreciated.

 Thanks,

 Neil


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: ngRepeat iterating over a non-array - is this kosher or a bad idea?

2014-05-15 Thread Domenico Matteo
I'm not sure if I correctly understood your question (maybe you provide a 
plnkr?), 
but if you are asking Is it a good idea to iterate over the properties of 
an Object?, 
I can certainly say that is OK

Cheers

On Thursday, 15 May 2014 01:41:30 UTC+2, Eric Eslinger wrote:

 Short question: if I have an ng-repeat set up where the underlying 
 collection is a plain object rather than an array, things still mostly work 
 (except for sorting, for some reason). I'm wondering if this is intended / 
 supported, or if I'm relying on a bug. Follow-up question is, how does one 
 get that to work with filters and sorts, as they don't seem to work quite 
 right.

 Longer version of the question:

 My specific issue is that my api objects have large-ish lists of related 
 objects, and that list can change over time (e.g., comments on a forum 
 post). Ideally, I'd be able to apply these changes without invalidating the 
 existing collection. So instead of doing $http.get().then (data)- 
 @relatedList = data.values, I'd *way* rather only append to the end of the 
 list new entries in said list. My initial inclination is to just iterate 
 over data.values and say @relatedList[value.id] = value, ending up with 
 an object which is array-esque {1: {id: 1, ...}, 4: {id: 4, ...} ...}, 
 instead of [, [id:1...], , , [id: 4...] ...] getting created in the case 
 where relatedList is initialized as [] instead of {} 

 tangential - I'm relatively new to javascript, so I don't actually know if 
 having a very large sparse array is actually all that bad.

 The other alternative is to just use something like Array.some on the 
 relatedList like @relatedList.push(value) unless @relatedList.some (v)-
 v.id == value.id 

 That strikes me a bit expensive for these kinds of updates. Then again, 
 maybe it's no big deal - my @relatedList is probably only going to average 
 in the 20-50 range for most cases. So, maybe I'm doing premature 
 optimization.

 Anybody have any thoughts on this?

 e


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Video doesn't start muted on Firefox

2014-05-15 Thread Sirio Lombardi
 

  I can't manage to start a video muted in Firefox v29.0.1.

I have a video tag in an ng-repeat loop, and I want to start the video 
muted; however, it does't mute in Firefox. In Chrome it works well.

If I remove the ng-repeat, it works also in Firefox.

The code is very simple:

div ng-app=myApp ng-controller=myController
 div ng-repeat=number in numbers
  video src=http://techslides.com/demos/sample-videos/small.mp4; autoplay 
controls loop muted
  /video
  {{alert}} Video/div/div

I have put up a fiddle here. http://jsfiddle.net/YW6hP/6/

What am I missing?

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: How to redirect to another route?

2014-05-15 Thread Kowthal ganesh
Hi guys, 
I want to share my source with you i have some problem on routing, am new 
for angular js

'use strict';

var sampleApp =angular.module(myapp, [])

sampleApp.controller(MyController, function($scope, $location, $window) {
$scope.doClick = function() {
   //By using this location path i just embed the path 
in url it was reflecting there, but it was not routing to the page that i 
have mentioned below.
  $location.path('/home');
   }
});

sampleApp.config(['$routeProvider','$locationProvider', 
function($routeProvider,$locationProvider) {
$routeProvider.when('/home', {
templateUrl: 'pane.html',
controller : 'MnController'});
$routeProvider
.otherwise({redirectTo: '/home'});
}]);

Please suggest me to recover from these bug

On Wednesday, May 23, 2012 10:11:00 AM UTC+5:30, Freewind wrote:

 For example, there is a button Create in my page, and it has ng-click 
 attribute:

 button ng-click=create()Create/button

 And in the `create()` function, I want to do something, then redirect to 
 another route `#/show`, which is a client site route defined in angularjs:

 function MyCtrl($scope) {
 $scope.create = function() {
  // do something
  // how to redirect to `#/show`, another view and controller 
 will be used
 }
 }




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Form Validation Not Working For Some Users

2014-05-15 Thread cutey Love
I'm not really sure what you mean? the only validation im using is default 
ng-length and form type email, the rest I leave to angular.
 

On Wednesday, May 14, 2014 9:08:22 AM UTC+1, Sander Elias wrote:

 Hi,

 Its not about validators. The problem is that the programs I told you 
 about change the data outside angulars scope. So it becomes your
 responsibility to inform angular of the newly arrived data.

 Regards
 Sander


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] $http.get not working

2014-05-15 Thread Yonatan Kra
Hi,
I have the following directive which sends a get request to the server.
Here is the code:
var params = {

 data: {
 'userID': $scope.tasks.id,
 'Age': $scope.aversion.choice,
 'Experience': $scope.aversion.choice,
 'Gender': $scope.aversion.choice,
 'Nationality': $scope.aversion.choice,
 'Assets': $scope.aversion.choice
 },
 task: 'questions'
 
 };
var httpConfig = {'params': params};
$http.get(ajax/dbHandler.php,httpConfig).success(function(data){
console.log(data);
});
This doesn't work. When I use the following address:
ajax/dbHandler.php?userID=5Age=33Experience=10Gender=maleNationality=somewhereAssets=100
I get the correct response, but not with angular http.
What's the right way to use params?
thanks

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: How to redirect to another route?

2014-05-15 Thread Mickey Vashchinsky
Or you can use ui-router https://github.com/angular-ui/ui-router with 
which you define states, so you have showState among others (and you can 
nest them too) which has a template + controller that you need.

var myApp = angular.module(MyApp, [ui.router])
.config(function($urlRouterProvider, $stateProvider) {
// ...
$stateProvider.state(showState, {
url: /show,
controller: ShowCtrl,
templateUrl: /templates/show.tpl.html
});
// ...
});

Then you can:

function MyCtrl($scope, $state) {
$scope.create = function() {
// do something
// ...
// redirect to `#/show`, another view and controller will be used
$state.go(showState);
}
}

Hope that was helpful.


On Wednesday, May 23, 2012 7:41:00 AM UTC+3, Freewind wrote:

 For example, there is a button Create in my page, and it has ng-click 
 attribute:

 button ng-click=create()Create/button

 And in the `create()` function, I want to do something, then redirect to 
 another route `#/show`, which is a client site route defined in angularjs:

 function MyCtrl($scope) {
 $scope.create = function() {
  // do something
  // how to redirect to `#/show`, another view and controller 
 will be used
 }
 }




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: $http.get not working

2014-05-15 Thread Filipe Monteiro
Hi Yonatan,

I know you already solved the problem, but your first problem was: You 
don't always need to use the data attribute to specify params. According 
to what your server was expecting your params should be:

var params = {

 'userID': $scope.tasks.id,
 'Age': $scope.aversion.choice,
 'Experience': $scope.aversion.choice,
 'Gender': $scope.aversion.choice,
 'Nationality': $scope.aversion.choice,
'Assets': $scope.aversion.choice,
 task: 'questions'
 
 };

Em quinta-feira, 15 de maio de 2014 07h47min39s UTC-3, Yonatan Kra escreveu:

 Hi,
 I have the following directive which sends a get request to the server.
 Here is the code:
 var params = {

  data: {
  'userID': $scope.tasks.id,
  'Age': $scope.aversion.choice,
  'Experience': $scope.aversion.choice,
  'Gender': $scope.aversion.choice,
  'Nationality': $scope.aversion.choice,
  'Assets': $scope.aversion.choice
  },
  task: 'questions'
  
  };
 var httpConfig = {'params': params};
 $http.get(ajax/dbHandler.php,httpConfig).success(function(data){
 console.log(data);
 });
 This doesn't work. When I use the following address:

 ajax/dbHandler.php?userID=5Age=33Experience=10Gender=maleNationality=somewhereAssets=100
 I get the correct response, but not with angular http.
 What's the right way to use params?
 thanks


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Help! I got troubles with my AngularJS delete(by.id)

2014-05-15 Thread Mathias Christensen
I've done that, but still not working. I do have in mind, that maybe I 
should store my data before it can get it by id or something? I'm quite new 
to angularjs :/

Den torsdag den 15. maj 2014 14.09.19 UTC+2 skrev Filipe Monteiro:

 Your scope functions are inside of your http.get success. You should put 
 those functions out of this promise.

 Em quinta-feira, 15 de maio de 2014 08h45min59s UTC-3, Mathias Christensen 
 escreveu:

 Hello everyone! I'm using Couchdb to store my data. and createNewCustomer 
 + the list of customers works fine. I need help to delete.

 This is my ng-click:


 tda ng-click=remove(customers.id) class=btn 
 btn-small btn-danger style=width:100px;Delete 
 {{customers.doc.company}}/a/td

 I've tried a lot of stuff inside my controller, and this is what I got so 
 far. This is both the listing and now I want to add the delete function 
 inside same ctrl.:


 var customerListApp = angular.module('customerListApp', []);

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 http.get('
 http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function(data)
  {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;

 ---vvv---

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }



 });
 }]);



 It seems like nothing is happening when I click the button. Help! :)



-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Repetitive patterns

2014-05-15 Thread breaddes
So far I came up with this: http://plnkr.co/edit/didVzYHWZbNY6r9QlKi1

Does this make any sense?



Am Donnerstag, 15. Mai 2014 13:36:37 UTC+2 schrieb breaddes:

 I wonder how deal with repetitive patterns in angular. Here is an example: 
 http://plnkr.co/edit/o8ex2IwVieEb8MxEBP01

 In an OOP pattern I would have created a veg class that shares all common 
 attributes and methods.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Help! I got troubles with my AngularJS delete(by.id)

2014-05-15 Thread Mathias Christensen
Hello. I've done that now, but still doesn't work. Should my delete form 
look different? Should I store my data somehow or anything?


Den torsdag den 15. maj 2014 14.09.19 UTC+2 skrev Filipe Monteiro:

 Your scope functions are inside of your http.get success. You should put 
 those functions out of this promise.

 Em quinta-feira, 15 de maio de 2014 08h45min59s UTC-3, Mathias Christensen 
 escreveu:

 Hello everyone! I'm using Couchdb to store my data. and createNewCustomer 
 + the list of customers works fine. I need help to delete.

 This is my ng-click:


 tda ng-click=remove(customers.id) class=btn 
 btn-small btn-danger style=width:100px;Delete 
 {{customers.doc.company}}/a/td

 I've tried a lot of stuff inside my controller, and this is what I got so 
 far. This is both the listing and now I want to add the delete function 
 inside same ctrl.:


 var customerListApp = angular.module('customerListApp', []);

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 http.get('
 http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function(data)
  {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;
 });
 ---vvv---

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }




 }]);



 It seems like nothing is happening when I click the button. Help! :)



-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Help! I got troubles with my AngularJS delete(by.id)

2014-05-15 Thread Mathias Christensen
I just tried that, and still doesn't seem to work. But I figured something 
out. I tried this:

var customerListApp = angular.module('customerListApp', []);

customerListApp.controller('customerListCtrl', ['$scope', '$http',
function (scope, http) {


http.get('http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function
 
(data) {
scope.customerList = data.rows;

scope.sortField = 'company';
scope.reverse = true;
});

scope.remove = function (id) {
scope.customerList.splice(id, 1)
}

}]);


This little form -  scope.remove = function (id) {
scope.customerList.splice(id, 1)
}
- Deletes the object from the view which I wanted it to. BUT, when I 
refresh the page, the data comes back. I want to delete the information 
completely from couchdb. Any advice here?




Den torsdag den 15. maj 2014 14.17.21 UTC+2 skrev Filipe Monteiro:

 have you tried like this:

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }

 http.get('http://127.0.0.1:5984/customers/_all_docs?
 include_docs=true').success(function (data) {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;
 });


 }]);

 It should work.


 2014-05-15 9:13 GMT-03:00 Mathias Christensen 
 mathias...@gmail.comjavascript:
 :

 I've done that, but still not working. I do have in mind, that maybe I 
 should store my data before it can get it by id or something? I'm quite new 
 to angularjs :/

 Den torsdag den 15. maj 2014 14.09.19 UTC+2 skrev Filipe Monteiro:

 Your scope functions are inside of your http.get success. You should put 
 those functions out of this promise.

 Em quinta-feira, 15 de maio de 2014 08h45min59s UTC-3, Mathias 
 Christensen escreveu:

 Hello everyone! I'm using Couchdb to store my data. and 
 createNewCustomer + the list of customers works fine. I need help to 
 delete.

 This is my ng-click:


 tda ng-click=remove(customers.id) class=btn 
 btn-small btn-danger style=width:100px;Delete 
 {{customers.doc.company}}/a/td

 I've tried a lot of stuff inside my controller, and this is what I got 
 so far. This is both the listing and now I want to add the delete function 
 inside same ctrl.:


 var customerListApp = angular.module('customerListApp', []);

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 http.get('http://127.0.0.1:5984/customers/_all_docs?
 include_docs=true').success(function (data) {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;

 ---vvv---

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }



 });
 }]);



 It seems like nothing is happening when I click the button. Help! :)

  -- 
 You received this message because you are subscribed to a topic in the 
 Google Groups AngularJS group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/angular/CGfo4fBKm4k/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 angular+u...@googlegroups.com javascript:.
 To post to this group, send email to ang...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Help! I got troubles with my AngularJS delete(by.id)

2014-05-15 Thread Filipe Monteiro
you need to call some function (rest, for example) to delete this register
in your database, the angular part is working perfectly.


2014-05-15 9:34 GMT-03:00 Mathias Christensen mathias.soll...@gmail.com:

 I just tried that, and still doesn't seem to work. But I figured something
 out. I tried this:

 var customerListApp = angular.module('customerListApp', []);

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 http.get('
 http://127.0.0.1:5984/customers/_all_docs?include_docs=true').success(function(data)
  {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;
 });

 scope.remove = function (id) {
 scope.customerList.splice(id, 1)
 }

 }]);


 This little form -  scope.remove = function (id) {
 scope.customerList.splice(id, 1)
 }
 - Deletes the object from the view which I wanted it to. BUT, when I
 refresh the page, the data comes back. I want to delete the information
 completely from couchdb. Any advice here?




 Den torsdag den 15. maj 2014 14.17.21 UTC+2 skrev Filipe Monteiro:

 have you tried like this:

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }

 http.get('http://127.0.0.1:5984/customers/_all_docs?include_
 docs=true').success(function (data) {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;
 });


 }]);

 It should work.


 2014-05-15 9:13 GMT-03:00 Mathias Christensen mathias...@gmail.com:

 I've done that, but still not working. I do have in mind, that maybe I
 should store my data before it can get it by id or something? I'm quite new
 to angularjs :/

 Den torsdag den 15. maj 2014 14.09.19 UTC+2 skrev Filipe Monteiro:

 Your scope functions are inside of your http.get success. You should
 put those functions out of this promise.

 Em quinta-feira, 15 de maio de 2014 08h45min59s UTC-3, Mathias
 Christensen escreveu:

 Hello everyone! I'm using Couchdb to store my data. and
 createNewCustomer + the list of customers works fine. I need help to 
 delete.

 This is my ng-click:


 tda ng-click=remove(customers.id) class=btn
 btn-small btn-danger style=width:100px;Delete
 {{customers.doc.company}}/a/td

 I've tried a lot of stuff inside my controller, and this is what I got
 so far. This is both the listing and now I want to add the delete function
 inside same ctrl.:


 var customerListApp = angular.module('customerListApp', []);

 customerListApp.controller('customerListCtrl', ['$scope', '$http',
 function (scope, http) {

 http.get('http://127.0.0.1:5984/customers/_all_docs?include_
 docs=true').success(function (data) {
 scope.customerList = data.rows;

 scope.sortField = 'company';
 scope.reverse = true;

 ---vvv---

 scope.remove = function (id) {
 for (i in customers) {
 if (customers[i].id == id) {
 customers.splice(i, 1);
 }
 }
 }



 });
 }]);



 It seems like nothing is happening when I click the button. Help! :)

  --
 You received this message because you are subscribed to a topic in the
 Google Groups AngularJS group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/angular/CGfo4fBKm4k/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 angular+u...@googlegroups.com.
 To post to this group, send email to ang...@googlegroups.com.

 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to a topic in the
 Google Groups AngularJS group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/angular/CGfo4fBKm4k/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: binding Html with Angular code inside

2014-05-15 Thread Kamal
Hi Yves,

Why dont you use ngInclude 
https://docs.angularjs.org/api/ng/directive/ngIncludewith templates, 
where you can change the template name as and when needed.

Cheers,
Kamal


On Wednesday, 14 May 2014 18:26:21 UTC+5:30, Yves Kircher wrote:

 *Hi, *

 *How can i bind a html code into a div, that has angular features inside ?*

 *Example:*


 script type=text/javascript src=
 http://ci.angularjs.org/job/angular.js-angular-master/ws/build/angular.js
 /script
 script type=text/javascript src=
 http://ci.angularjs.org/job/angular.js-angular-master/ws/build/angular-sanitize.js
 /script

 html ng-app
 head
 script
 function Ctrl($scope, $sce) {
 $scope.var = My Headline;
 $scope.ngHtmlSnippet = Headline:h1{{ var }}/h1;
  $scope.deliberatelyTrustDangerousSnippet = function() {
 return $sce.trustAsHtml($scope.ngHtmlSnippet);
 };
 }
 /script
 /head
 body ng-controller=Ctrl
 textarea ng-model=ngHtmlSnippet cols=60 rows=3/textarea
 div ng-bind-html=deliberatelyTrustDangerousSnippet()/div
 /body
 /html


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Framework for REST integration

2014-05-15 Thread mario
Hello Fabrizio

You can easily do that with AngularJS.

For a minimal demo see this plunkr: 
http://plnkr.co/edit/K9t3kRklhTLN2aLOeKKi?p=preview

Cheers
Mario



On Wednesday, May 14, 2014 7:21:09 PM UTC+2, Fabrizio Reale wrote:

 Hi all,
 I often need to develop a common partner:
 A text that is read from a REST service.
 Near the text there is a button or an icon that turns the text into an 
 input tag where the user can edit the text.
 Near the input tag there are two buttons, one to confirm and the second to 
 cancel.
 If the confirm button is pressed the new value is saved through the REST 
 service.
 And the original text is updated.

 Is there any framework that provides widgets to do that for the common 
 cases (e.g.:radios, checkboxes, input, select)?

 Thank you,
 Fabrizio


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Re-usable AngularJS directive for NVD3 visualization (via JSON).

2014-05-15 Thread Demetrius Nunes
Awesome! I guess you can close the issue about basic documentation now. :)

Em quarta-feira, 14 de maio de 2014 23h59min13s UTC-3, krispo escreveu:

 Hi!

 Let me introduce you to AngularJS directive for nvD3 charts - 
 angular-nvd3https://github.com/krispo/angular-nvd3
 .

 It allows you to fully interact with nvD3 via JSON. 

 You can find more information and try it online on the web 
 pagehttp://krispo.github.io/angular-nvd3/
 . 

 Think, JSON structure can also help you to better understand the nvD3 
 charts api, that is not well documented yet.

 Best,
 Konstantin


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Trouble with Geolocation API and angularjs

2014-05-15 Thread Parker Woodworth
I ran into a similar problem using the 
angular-leaflet-directivehttps://github.com/tombatossals/angular-leaflet-directivemodule
 (which it looks like you might be using as well?). While I haven't 
had a chance to drill down into the source yet, it looks like the problem 
is being caused by a watcher on the map location which becomes overwhelmed 
(that is to say, too many digest cycles triggered) by the leaflet animation 
when the map position is changed programatically.

disabling the animation solves the problem (although it is not ideal that 
this needs to be the solution).

I haven't found a way to disable animation as a master setting yet, but I 
was able to solve the problem for each particular center change event by 
accessing the map object directly and using leaflet's built in .panTo() 
function like so:

leafletData.getMap().then(function(map) { 
map.panTo([new_lat, new_long], {animate:false})
});

here'shttp://tombatossals.github.io/angular-leaflet-directive/examples/access-leaflet-object-example.htmlan
 example of how to access the map object directly (hint: you'll need to 
import the leafletData module).

hope this helps.


P

On Friday, April 11, 2014 3:01:39 AM UTC-4, Sylvain M. wrote:

 Hi,

 I'm having trouble with angularJS and geolocation API (cordova app).


 $scope.GEOsucces=function(position) 
 { 
 var newpos ={ lat: position.coords.latitude, lng: 
 position.coords.longitude, altitude: position.coords.altitude };
 var newcenter={ lat: position.coords.latitude, lng: 
 position.coords.longitude, zoom: 15 };
 $scope.$emit('NEW_GPS',newpos, newcenter);

 return false;
 };

 $scope.GEOerreur=function(err) 
 {
 $log.info(GPS error...);
 return false;
 }; 

 $scope.$on(NEW_GPS, function(event, pos, centre)
 {
 $scope.$apply(function() 
  {
 $scope.mytrace.path.p2.latlngs.push(pos); 
 $scope.mytrace.centre.lat = centre.lat;
 $scope.mytrace.centre.lng = centre.lng;
 });
 $log.info($scope.mytrace);
 });

 GeoLoc = navigator.geolocation.watchPosition($scope.GEOsucces, 
 $scope.GEOerreur, { maximumAge: 3000, timeout: 1, enableHighAccuracy: 
 true}); 

 It works for a while and then I get the following error : 

 http://errors.angularjs.org/1.2.12/$rootScope/infdig?p0=10p1=%5B%5B%22fn%3
 …406%2C%5C%22zoom%5C%22%3A13%2C%5C%22autoDiscover%5C%22%3Afalse%7D%22%5D%5D
 at http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:7548:12
 at Scope.$digest (
 http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:19339:19)
 at Scope.$apply (
 http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:19553:24)
 at safeApply (
 http://127.0.0.1:1200/bower_components/angular-leaflet-directive/dist/angular-leaflet-directive.min.js:32:11561
 )
 at Object.anonymous (
 http://127.0.0.1:1200/bower_components/angular-leaflet-directive/dist/angular-leaflet-directive.min.js:31:21383
 )
 at o.Mixin.Events.fireEvent (
 http://127.0.0.1:1200/bower_components/leaflet-dist/leaflet.js:6:5055)
 at o.Map.Keyboard.o.Handler.extend._onBlur (
 http://127.0.0.1:1200/bower_components/leaflet-dist/leaflet.js:9:8418)
 at HTMLDivElement.t.(anonymous function).s [as _leaflet_blur13] (
 http://127.0.0.1:1200/bower_components/leaflet-dist/leaflet.js:8:20284) 
 ionic.bundle.js:16905
 Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. 
 Aborting!
 Watchers fired in the last 5 iterations: [[fn: parentValueWatch; newVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false};
  
 oldV...omitted...5D ionic.bundle.js:7548
 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
 Watchers fired in the last 5 iterations: [[fn: parentValueWatch; newVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false},center;
  
 newVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false}],[fn:
  
 parentValueWatch; newVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false},center;
  
 newVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false}],[fn:
  
 parentValueWatch; newVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false},center;
  
 newVal: 
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false};
  
 oldVal: 
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false}],[fn:
  
 parentValueWatch; newVal: 
 

[AngularJS] How to use ASP.NET MVC and AngularJS routing?

2014-05-15 Thread gsrjedi
I’m working on a new ASP.NET MVC and AngularJS application that is intended 
to be a collection of SPAs.  I’m using the MVC areas concept to separate 
each individual SPA, and then I’m using AngularJS within each MVC area to 
create the SPA.

Since I’m new to AngularJS and haven’t been able to find an answer 
regarding combining both MVC and AngularJS routing, I thought I’d post my 
question here to see if I could get some help.

I have the standard MVC routing setup, which serves up each MVC area.

public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute({resource}.axd/{*pathInfo});
routes.MapMvcAttributeRoutes();
routes.MapRoute(
name: Default,
url: {controller}/{action}/{id},
defaults: new { controller = Home, action = Index, id = 
UrlParameter.Optional }
);
routes.AppendTrailingSlash = true;
}

This works fine and gives me URLs like:

http://localhost:4/Application1/
http://localhost:4/Application2/

Now, within each application area, I’m trying to use AngularJS routing, 
also using $locationProvider.html5Mode(true); so that I get the client-side 
routing within each area, something like:

http://localhost:4/Application1/view1
http://localhost:4/Application1/view2
http://localhost:4/Application2/view1/view1a
http://localhost:4/Application2/view2/view2a
http://localhost:4/Application2/view3

Here’s my AngularJS routing snippet for Application1:

app1.config(['$routeProvider', '$locationProvider', function 
($routeProvider, $locationProvider) {
var viewBase = '/Areas/Application1/app/views/';
$routeProvider
.when('/Application1/view1', {
controller: 'View1Controller',
templateUrl: viewBase + 'view1.html'
})
.when('/Application2/view2', {
controller: 'View2Controller',
templateUrl: viewBase + 'view2.html'
})
.otherwise({ redirectTo: '/Application1/view1' });
$locationProvider.html5Mode(true);
}]);

So, initially, it seems to work (at least the URL looks correct).  But, 
when I start navigating between areas or views within an area, or even if I 
refresh, something gets “lost” and things don’t work.  The URL still looks 
correct but views aren’t found and aren’t getting loaded correctly.

Any help/guidance on how to make ASP.NET MVC and AngularJS routing work 
together to give me the scenario described above?

Thanks!!!


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Framework for REST integration

2014-05-15 Thread Fabrizio Reale
Hello Mario,

You can easily do that with AngularJS.

 For a minimal demo see this plunkr: 
 http://plnkr.co/edit/K9t3kRklhTLN2aLOeKKi?p=preview


Thank you for your answer.
But I already know how to do that.
I was wondering in there is module that let me avoid to write all that code 
for each field and beside switching from view to edit it should save the 
data using the REST API.

Fabrizio


 

 On Wednesday, May 14, 2014 7:21:09 PM UTC+2, Fabrizio Reale wrote:

 Hi all,
 I often need to develop a common partner:
 A text that is read from a REST service.
 Near the text there is a button or an icon that turns the text into an 
 input tag where the user can edit the text.
 Near the input tag there are two buttons, one to confirm and the second 
 to cancel.
 If the confirm button is pressed the new value is saved through the REST 
 service.
 And the original text is updated.

 Is there any framework that provides widgets to do that for the common 
 cases (e.g.:radios, checkboxes, input, select)?

 Thank you,
 Fabrizio



-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] Re: Trouble with Geolocation API and angularjs

2014-05-15 Thread Sylvain M.
Thank you for the answer.

I confirmed that the error was in angular-leaflet-directive too. I moved to
angular-google-maps and then it works fine.

Nice job, you have found where the bug was... I will wait until some fix is
done prior to go back to angular-leaflet-directive.

Onq question : how would you do to get direct access to the map object if
there are two leaflets object on the document ...



2014-05-15 17:04 GMT+02:00 Parker Woodworth par...@jumpshell.com:

 I ran into a similar problem using the 
 angular-leaflet-directivehttps://github.com/tombatossals/angular-leaflet-directivemodule
  (which it looks like you might be using as well?). While I haven't
 had a chance to drill down into the source yet, it looks like the problem
 is being caused by a watcher on the map location which becomes overwhelmed
 (that is to say, too many digest cycles triggered) by the leaflet animation
 when the map position is changed programatically.

 disabling the animation solves the problem (although it is not ideal that
 this needs to be the solution).

 I haven't found a way to disable animation as a master setting yet, but I
 was able to solve the problem for each particular center change event by
 accessing the map object directly and using leaflet's built in .panTo()
 function like so:

 leafletData.getMap().then(function(map) {
 map.panTo([new_lat, new_long], {animate:false})
 });

 here'shttp://tombatossals.github.io/angular-leaflet-directive/examples/access-leaflet-object-example.htmlan
  example of how to access the map object directly (hint: you'll need to
 import the leafletData module).

 hope this helps.


 P

 On Friday, April 11, 2014 3:01:39 AM UTC-4, Sylvain M. wrote:

 Hi,

 I'm having trouble with angularJS and geolocation API (cordova app).


 $scope.GEOsucces=function(position)
  {
 var newpos ={ lat: position.coords.latitude, lng:
 position.coords.longitude, altitude: position.coords.altitude };
  var newcenter={ lat: position.coords.latitude, lng:
 position.coords.longitude, zoom: 15 };
 $scope.$emit('NEW_GPS',newpos, newcenter);

 return false;
 };

 $scope.GEOerreur=function(err)
  {
 $log.info(GPS error...);
 return false;
  };

 $scope.$on(NEW_GPS, function(event, pos, centre)
  {
 $scope.$apply(function()
  {
  $scope.mytrace.path.p2.latlngs.push(pos);
 $scope.mytrace.centre.lat = centre.lat;
 $scope.mytrace.centre.lng = centre.lng;
  });
 $log.info($scope.mytrace);
 });

 GeoLoc = navigator.geolocation.watchPosition($scope.GEOsucces,
 $scope.GEOerreur, { maximumAge: 3000, timeout: 1, enableHighAccuracy:
 true});

 It works for a while and then I get the following error :

 http://errors.angularjs.org/1.2.12/$rootScope/infdig?p0=10;
 p1=%5B%5B%22fn%3…406%2C%5C%22zoom%5C%22%3A13%2C%5C%
 22autoDiscover%5C%22%3Afalse%7D%22%5D%5D
 at http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:7548:12
 at Scope.$digest (http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:
 19339:19)
 at Scope.$apply (http://127.0.0.1:1200/lib/ionic/js/ionic.bundle.js:
 19553:24)
 at safeApply (http://127.0.0.1:1200/bower_components/angular-leaflet-
 directive/dist/angular-leaflet-directive.min.js:32:11561)
 at Object.anonymous (http://127.0.0.1:1200/bower_
 components/angular-leaflet-directive/dist/angular-
 leaflet-directive.min.js:31:21383)
 at o.Mixin.Events.fireEvent (http://127.0.0.1:1200/bower_
 components/leaflet-dist/leaflet.js:6:5055)
 at o.Map.Keyboard.o.Handler.extend._onBlur (
 http://127.0.0.1:1200/bower_components/leaflet-dist/leaflet.js:9:8418)
 at HTMLDivElement.t.(anonymous function).s [as _leaflet_blur13] (
 http://127.0.0.1:1200/bower_components/leaflet-dist/leaflet.js:8:20284)
 ionic.bundle.js:16905
 Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached.
 Aborting!
 Watchers fired in the last 5 iterations: [[fn: parentValueWatch; newVal:
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\
 zoom\:13,\autoDiscover\:false}; oldV...omitted...5D
 ionic.bundle.js:7548
 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
 Watchers fired in the last 5 iterations: [[fn: parentValueWatch; newVal:
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\
 zoom\:13,\autoDiscover\:false}; oldVal: {\lat\:43.468057820224466,\
 lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false},center;
 newVal: {\lat\:43.46768406520923,\lng\:3.7128639221191406,\
 zoom\:13,\autoDiscover\:false}; oldVal: {\lat\:43.468057820224466,\
 lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false}],[fn:
 parentValueWatch; newVal: {\lat\:43.468057820224466,\
 lng\:3.715953826904297,\zoom\:13,\autoDiscover\:false}; oldVal:
 {\lat\:43.46768406520923,\lng\:3.7128639221191406,\
 zoom\:13,\autoDiscover\:false},center; newVal:
 {\lat\:43.468057820224466,\lng\:3.715953826904297,\
 zoom\:13,\autoDiscover\:false}; oldVal: {\lat\:43.46768406520923,\
 lng\:3.7128639221191406,\zoom\:13,\autoDiscover\:false}],[fn:
 parentValueWatch; newVal: {\lat\:43.46768406520923,\
 

[AngularJS] Re: How to use ASP.NET MVC and AngularJS routing?

2014-05-15 Thread steven smock
Here is what worked for my last MVC 5 project:

1. Create a folder called Asset within the site root.  This is where the 
HTML templates, partials, and lazy-loaded scripts will go.
2. Add an IgnoreRoute for Asset/{*all} within your RegisterRoutes config 
method.

I am not, however, using HTML5 mode for routing, instead sticking with 
hashy URLs.

Good luck!

On Thursday, May 15, 2014 11:16:56 AM UTC-4, gsr...@gmail.com wrote:

 I’m working on a new ASP.NET MVC and AngularJS application that is 
 intended to be a collection of SPAs.  I’m using the MVC areas concept to 
 separate each individual SPA, and then I’m using AngularJS within each MVC 
 area to create the SPA.

 Since I’m new to AngularJS and haven’t been able to find an answer 
 regarding combining both MVC and AngularJS routing, I thought I’d post my 
 question here to see if I could get some help.

 I have the standard MVC routing setup, which serves up each MVC area.

 public static void RegisterRoutes(RouteCollection routes)
 {
 routes.IgnoreRoute({resource}.axd/{*pathInfo});
 routes.MapMvcAttributeRoutes();
 routes.MapRoute(
 name: Default,
 url: {controller}/{action}/{id},
 defaults: new { controller = Home, action = Index, id 
 = UrlParameter.Optional }
 );
 routes.AppendTrailingSlash = true;
 }

 This works fine and gives me URLs like:

 http://localhost:4/Application1/
 http://localhost:4/Application2/

 Now, within each application area, I’m trying to use AngularJS routing, 
 also using $locationProvider.html5Mode(true); so that I get the client-side 
 routing within each area, something like:

 http://localhost:4/Application1/view1
 http://localhost:4/Application1/view2
 http://localhost:4/Application2/view1/view1a
 http://localhost:4/Application2/view2/view2a
 http://localhost:4/Application2/view3

 Here’s my AngularJS routing snippet for Application1:

 app1.config(['$routeProvider', '$locationProvider', function 
 ($routeProvider, $locationProvider) {
 var viewBase = '/Areas/Application1/app/views/';
 $routeProvider
 .when('/Application1/view1', {
 controller: 'View1Controller',
 templateUrl: viewBase + 'view1.html'
 })
 .when('/Application2/view2', {
 controller: 'View2Controller',
 templateUrl: viewBase + 'view2.html'
 })
 .otherwise({ redirectTo: '/Application1/view1' });
 $locationProvider.html5Mode(true);
 }]);

 So, initially, it seems to work (at least the URL looks correct).  But, 
 when I start navigating between areas or views within an area, or even if I 
 refresh, something gets “lost” and things don’t work.  The URL still looks 
 correct but views aren’t found and aren’t getting loaded correctly.

 Any help/guidance on how to make ASP.NET MVC and AngularJS routing work 
 together to give me the scenario described above?

 Thanks!!!




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] 'defer' undefined when using $q in controller

2014-05-15 Thread Chris Rhoden
Also, here's a hint. It isn't saying that defer is undefined, it's saying
that you're trying to read the `defer` property of undefined.


On Thu, May 15, 2014 at 11:51 AM, Chris Rhoden carho...@gmail.com wrote:

 You aren't injecting $q, because your injection annotation does not
 include it.


 On Thu, May 15, 2014 at 11:46 AM, Chris squirrelra...@gmail.com wrote:

 hi all,

 i'm new to angularjs, trying to use $q in a controller with no luck.  any
 ideas?
 thanks

 TypeError: Cannot read property 'defer' of undefined


 Application.Controllers.controller(XXX, ['$scope'], function($scope,
 $q) {

 $scope.myFunc = function(){
  var defer = $q.defer(),
 myPromise;

 myPromise = $scope.getData()
  .then($scope.getData2)
 .then(function(data) {
 defer.resolve(); // resolve our defer
 });
  // return our promise
 return defer.promise();
  }
 });

 --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




 --
 chrisrhoden




-- 
chrisrhoden

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] 'defer' undefined when using $q in controller

2014-05-15 Thread Chris
I guess I don't understand where $q comes from.  I thought you would have 
full access just like $ if you in jQuery.  
Even if I do something like this, it has to be defined somewhere else?

Application.Controllers.controller(XXX, ['$scope', '$q'], 
function($scope, $q) {




On Thursday, May 15, 2014 11:51:25 AM UTC-4, Chris Rhoden wrote:

 You aren't injecting $q, because your injection annotation does not 
 include it.


 On Thu, May 15, 2014 at 11:46 AM, Chris squirr...@gmail.com javascript:
  wrote:

 hi all,

 i'm new to angularjs, trying to use $q in a controller with no luck.  any 
 ideas?  
 thanks

 TypeError: Cannot read property 'defer' of undefined


 Application.Controllers.controller(XXX, ['$scope'], function($scope, 
 $q) {

 $scope.myFunc = function(){
  var defer = $q.defer(),
 myPromise;
  
 myPromise = $scope.getData()
  .then($scope.getData2)
 .then(function(data) {
 defer.resolve(); // resolve our defer
 });
  // return our promise
 return defer.promise();
  }
 });

 -- 
 You received this message because you are subscribed to the Google Groups 
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to angular+u...@googlegroups.com javascript:.
 To post to this group, send email to ang...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 chrisrhoden 


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Lazy Loading with Angular

2014-05-15 Thread Jagadesh Paladugula
Hello Everyone,

Does Angular support lazy loading by default? If so, could any one provide
some working examples.

-- 
Regards
Jagadesh

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Repetitive patterns

2014-05-15 Thread Sander Elias
Hi Breaddes,

There are multiple way's to solve this.
What do you think about 
 this: http://plnkr.co/edit/A2bW7Fatg0aEEoKqqp0Q?p=preview

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Headless web driver with AngularJS

2014-05-15 Thread Lee Rosenberg
We have a site under development that uses AngularJS and I'm working to 
create some automation tests against it.  I'm using PhantomJS web driver 
with Selenium for the headless tests.  When I use the Firefox web driver, 
everything works wonderfully.  When I use the headless PhantomJS web 
driver, the same exact commands don't seem to build out the page elements 
with Angular.  I've also posted this problem in a group related to 
PhantomJS, but haven't gotten any answers.  Has anyone else had this 
problem automating against a site that uses Angular?

Thanks,
Lee Rosenberg

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: binding Html with Angular code inside

2014-05-15 Thread Filipe Monteiro
You can use the $compile service.

return $compile($scope.ngHtmlSnippet)($scope);

Em quarta-feira, 14 de maio de 2014 09h56min21s UTC-3, Yves Kircher 
escreveu:

 *Hi, *

 *How can i bind a html code into a div, that has angular features inside ?*

 *Example:*


 script type=text/javascript src=
 http://ci.angularjs.org/job/angular.js-angular-master/ws/build/angular.js
 /script
 script type=text/javascript src=
 http://ci.angularjs.org/job/angular.js-angular-master/ws/build/angular-sanitize.js
 /script

 html ng-app
 head
 script
 function Ctrl($scope, $sce) {
 $scope.var = My Headline;
 $scope.ngHtmlSnippet = Headline:h1{{ var }}/h1;
  $scope.deliberatelyTrustDangerousSnippet = function() {
 return $sce.trustAsHtml($scope.ngHtmlSnippet);
 };
 }
 /script
 /head
 body ng-controller=Ctrl
 textarea ng-model=ngHtmlSnippet cols=60 rows=3/textarea
 div ng-bind-html=deliberatelyTrustDangerousSnippet()/div
 /body
 /html


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Video doesn't start muted on Firefox

2014-05-15 Thread Sirio Lombardi


Il giorno giovedì 15 maggio 2014 11:10:59 UTC+2, Sirio Lombardi ha scritto:

  
   I can't manage to start a video muted in Firefox v29.0.1.

 I have a video tag in an ng-repeat loop, and I want to start the video 
 muted; however, it does't mute in Firefox. In Chrome it works well.

 If I remove the ng-repeat, it works also in Firefox.

 The code is very simple:

 div ng-app=myApp ng-controller=myController
  div ng-repeat=number in numbers
   video src=http://techslides.com/demos/sample-videos/small.mp4; autoplay 
 controls loop muted
   /video
   {{alert}} Video/div/div

 I have put up a fiddle here. http://jsfiddle.net/YW6hP/6/

 What am I missing?


*UPDATE*

At last I resolved with this directive I put in my video tags:

.directive('myVideo', function () {
return {
  restrict: 'A',
  scope: {},
  link: function(scope, element, attrs) {
element[0].muted = true;
   }
};
})

Hope this may help others!  

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Headless web driver with AngularJS

2014-05-15 Thread Edgars Zagorskis
I had similar issues (works in browser, fails in phanotmjs) while 
doing integration tests on a website which used one of popular twitter 
bootstrap adaptations for AngularJS. 
It just didn't want to work (element wasn't created in time). I solved it 
by getting rid of 3rd party bootstrap directives and removing jQuery (which 
also was there). Then tests passed. 
TL;DR - do you have 3rd party code (directives?) there and have you tried 
testing without them




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Lazy Loading with Angular

2014-05-15 Thread Edgars Zagorskis
AFAIK everybody uses RequireJS. There are hundreds of tutorials and 
examples out there.




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Learning AngularJS complete step by step guide for beginners.

2014-05-15 Thread Zaheer Ahmed

Guide for beginners to learn AngularJS : 
Easy to understand post on Model View Controller or Model View View Model 
(MVVM) in AngularJS

http://conceptf1.blogspot.com/2014/04/learning-angularjs-part2.html

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Form Validation Not Working For Some Users

2014-05-15 Thread Justin Walsh
Sander is saying that the password manager/form-filling solution built into 
the browser *may be* pre-populating the username/password fields *outside 
of the digest cycle of angular* and therefore the submit button is not 
enabled (as the validation has not run).

A few users are having an issue where my submit button is not active when 
 they fill forms in.


So... are these users actually filling the form in (by typing on the 
keyboard) or is the form being auto-populated? 

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Headless web driver with AngularJS

2014-05-15 Thread Lee Rosenberg
We have a number of third party js add-ons.  We tried to remove the 
ui-bootstrap one, but same result.  I'm guessing we may need to go through 
a long process of elimination to find out if one of those is the culprit.

Thanks for the reply, this was helpful.

On Thursday, May 15, 2014 11:48:19 AM UTC-7, Edgars Zagorskis wrote:

 I had similar issues (works in browser, fails in phanotmjs) while 
 doing integration tests on a website which used one of popular twitter 
 bootstrap adaptations for AngularJS. 
 It just didn't want to work (element wasn't created in time). I solved it 
 by getting rid of 3rd party bootstrap directives and removing jQuery (which 
 also was there). Then tests passed. 
 TL;DR - do you have 3rd party code (directives?) there and have you tried 
 testing without them




-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


Re: [AngularJS] 'defer' undefined when using $q in controller

2014-05-15 Thread Chris Rhoden
nothing but `angular` is global.

To make your thing work you need to do:

Application.Controllers.controller(XXX, ['$scope', '$q', function($scope,
$q) {

...

}]);

Note that this is not an endorsement of the apparent structure of your
application.

Typically, I chain all definitions off of the module object instead of
making them global, as in:

angular.module('module.name', ['module.dependency'])
.controller('ControllerName', ['$scope', '$q', function ($scope, $q) {
 ...
}])
.factory( ... );


On Thu, May 15, 2014 at 12:00 PM, Chris squirrelra...@gmail.com wrote:

 I guess I don't understand where $q comes from.  I thought you would have
 full access just like $ if you in jQuery.
 Even if I do something like this, it has to be defined somewhere else?

 Application.Controllers.controller(XXX, ['$scope', '$q'],
 function($scope, $q) {





 On Thursday, May 15, 2014 11:51:25 AM UTC-4, Chris Rhoden wrote:

 You aren't injecting $q, because your injection annotation does not
 include it.


 On Thu, May 15, 2014 at 11:46 AM, Chris squirr...@gmail.com wrote:

 hi all,

 i'm new to angularjs, trying to use $q in a controller with no luck.
  any ideas?
 thanks

 TypeError: Cannot read property 'defer' of undefined


 Application.Controllers.controller(XXX, ['$scope'], function($scope,
 $q) {

 $scope.myFunc = function(){
  var defer = $q.defer(),
 myPromise;

 myPromise = $scope.getData()
  .then($scope.getData2)
 .then(function(data) {
 defer.resolve(); // resolve our defer
 });
  // return our promise
 return defer.promise();
  }
 });

 --
 You received this message because you are subscribed to the Google
 Groups AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to angular+u...@googlegroups.com.
 To post to this group, send email to ang...@googlegroups.com.

 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




 --
 chrisrhoden

  --
 You received this message because you are subscribed to the Google Groups
 AngularJS group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to angular+unsubscr...@googlegroups.com.
 To post to this group, send email to angular@googlegroups.com.
 Visit this group at http://groups.google.com/group/angular.
 For more options, visit https://groups.google.com/d/optout.




-- 
chrisrhoden

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Focus an input added dynamically on mobile safari

2014-05-15 Thread Jeremy Kallman
Here is my issue:

I have an array of inputs that are bound to a ng-model inside an ng-repeat. 
Works really well for desktop - you can see the control at www.pro.com.

But for mobile we start with just 1 input and have a button to add 
additional inputs as you go. So, in the click handler, I add one more item 
to the backing array and I get a new input and then I focus that new input 
in a $timeout as the input DOM element doesn't exist until the current 
digest is finished. And that works fine except on mobile safari as it won't 
let me focus an input unless the original click event is in the call stack 
(http://stackoverflow.com/questions/6287478/mobile-safari-autofocus-text-field/7332160#7332160).

So I am wondering if anyone has a workaround for this? One idea I just had 
was to add an additional hidden input so I can just unhide it and focus 
immediately. I think that will work but that is pretty hacky so ideally 
there would be some way for me to run additional code at the end of the 
digest cycle after the dom has been updated inside the original call stack??

Any help would be appreciated.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Error: [$parse:syntax] from JSON echo'd from PHP. Angularjs min 1.2.12

2014-05-15 Thread Trash Match
I'm getting an angularjs error in my firebug console from JSON echo'd out 
with PHP.  Even when I strip out ALL references to angularjs, that PHP file 
STILL gives me the same error.  I'm guessing that angularjs is somehow 
monitoring anything that looks like JSON data, and trying to parse it?  I 
don't know.  This is the error:

Error: [$parse:syntax] http://errors.angularjs.org/1.2.12/$parse/syntax? etc., 
etc.


If I comment out the PHP echo statement, the error goes away.  The error 
stops execution of my code, and it took me a long time to isolate the line 
of code that was causing the error.  The other really strange thing, is 
that if I ECHO out some BAD JSON, I don't get an error.  If I echo some 
corrected JSON, I get an error.

If this is echo'd out with PHP, I get NO error.  This has no matching 
bracket on the end.

*All store Listings: {{0 : {ad:Rocker,ac:51,af:4,ah:IP 
Holder,ab:UnKnown,ae:Wooden Rocking Chair,ag:Looks 
Good,aa:D14169LkGmw},{1 : 
{ad:Car,ac:26900,al:jpg,af:5,ai:jpg,ah:IP 
Holder,ab:Toyota,ak:jpg,meet:Atlanta,ae:2013 Toyota Camry 
Hybrid Sedan,ag:Mint Looks,aa:E320141119PW93,aj:jpg},{2 : 
{ad:Rocker,ac:50,af:5,ah:IP 
Holder,ab:Unknown,ae:Wooden rocking chair.,ag:Looks 
Good,aa:D14169LkGmw},{3 : 
{ad:Car,ac:23000,al:jpg,af:5,ai:jpg,ah:IP 
Holder,ab:Subaru,ak:jpg,meet:**Detroit,ae:2013 Subaru 
Impreza Hatchback,ag:Mint Looks,aa:E3201412UeR90,aj:jpg}*

If this is echo'd out with PHP, I get the error, and my code gets killed.

*All store Listings: {{0 : {ad:Rocker,ac:51,af:4,ah:IP 
Holder,ab:UnKnown,ae:Wooden Rocking Chair,ag:Looks 
Good,aa:D14169LkGmw},{1 : 
{ad:Car,ac:26900,al:jpg,af:5,ai:jpg,ah:IP 
Holder,ab:Toyota,ak:jpg,meet:**Atlanta,ae:2013 Toyota Camry 
Hybrid Sedan,ag:Mint Looks,aa:E320141119PW93,aj:jpg},{2 : 
{ad:Rocker,ac:50,af:5,ah:IP 
Holder,ab:Unknown,ae:Wooden rocking chair.,ag:Looks 
Good,aa:D14169LkGmw},{3 : 
{ad:Car,ac:23000,al:jpg,af:5,ai:jpg,ah:IP 
Holder,ab:Subaru,ak:jpg,meet:Detroit,ae:2013 Subaru Impreza 
Hatchback,ag:Mint Looks,aa:E3201412UeR90,aj:jpg}}*

I'm concatenating arrays together as a string to create a multidimensional 
array.

if (strlen($oneStoreListing)  1) {
  //Keep adding single store listings to the array until the loop 
is done.
  $storeListingsData = $storeListingsData . trim($oneStoreListing) 
. ,;
  echo br;
  var_dump($storeListingsData);
  echo br;
}

Then when the loop is finished, I remove the unneeded comma at the end and 
replace it with a second curly brace.

  $storeListingsData = substr($storeListingsData,0,-1);
  $storeListingsData = $storeListingsData . };

Is angularjs searching and parsing anything that looks like JSON as soon as 
the page is loaded?  That's what it seems like.  I'll try creating the JSON 
some other way, other than by concatenating text, and see if that makes a 
difference.  But, in any case, finding the cause of this error was a real 
pain.  It seems like a bug to me.

I just updated to angular.min.js 1.2.16 and I'm getting the same error.

Error: [$parse:syntax] http://errors.angularjs.org/1.2.16/$parse/syntax?


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Error: [$parse:syntax] from JSON echo'd from PHP. Angularjs min 1.2.12

2014-05-15 Thread Trash Match
I just found out that my JSON was not right after all.  I had an extra 
curly brace at the beginning of every sub array.  That is part of my 
problem.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Error: [$parse:syntax] from JSON echo'd from PHP. Angularjs min 1.2.12

2014-05-15 Thread Trash Match
I figured out my problem.  I was constructing the JSON wrong.  I am going 
to construct the multi-dimensional array with text formulas after all.  I 
didn't have any luck pushing sub arrays into the array in PHP, then 
converting it back to JSON with JavaScript in the front end.  I'm going to 
add a counter as the array key, then a colon, then a comma at the end in a 
for loop:

$oneStoreListing = \ . $forCntrStore . \: . trim($oneStoreListing) . 
,;

  //Keep adding single store listings to the array until the loop 
is done.
  $storeListingsData = $storeListingsData . $oneStoreListing;

Then when the entire array is created, I need to strip the comma off the 
end, and add a curly brace:

  $storeListingsData = substr($storeListingsData,0,-1);
  $storeListingsData = { . $storeListingsData . };

I'm not getting an error from angularjs, and javascript JSON is converting 
the array in string format to an object for angularjs:

data = JSON.parse(data);

Creates an object for angularjs.

On Friday, May 16, 2014 12:17:21 AM UTC-4, Trash Match wrote:

 I just found out that my JSON was not right after all.  I had an extra 
 curly brace at the beginning of every sub array.  That is part of my 
 problem.


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Injecting $location service in config and calling path triggers 10 $digest() iterations reached

2014-05-15 Thread Mieczysław Daniel Dyba
I'm building an app that is composed of several mortgage calculators. Each 
calculator is a separate route in the app. I'm bootstrapping the angular 
app so that I can render any number of calculators simply by adding a data 
attribute to a div tag that points to the correct route.

Here is a Plunker to show you the gist of how I'm building the app: 
http://plnkr.co/edit/EAV7j8

I'm having trouble with injecting the $location service into the run 
function. These are the errors I'm getting:


   1. Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! 
   Watchers fired in the last 5 iterations: [[fn: $locationWatch; newVal: 8; 
   oldVal: 7,savvy; newVal: \Savvy?\; oldVal: undefined],[fn: 
   $locationWatch; newVal: 9; oldVal: 8,savvy; newVal: \Savvy?\; oldVal: 
   undefined],[fn: $locationWatch; newVal: 10; oldVal: 9,savvy; newVal: 
   \Savvy?\; oldVal: undefined],[fn: $locationWatch; newVal: 11; oldVal: 
   10,savvy; newVal: \Savvy?\; oldVal: undefined],[fn: $locationWatch; 
   newVal: 12; oldVal: 11,savvy; newVal: \Savvy?\; oldVal: undefined]] 
   
http://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10p1=%5B%5B%22fn%3…%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%5Dhttp://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10p1=%5B%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%208%3B%20oldVal%3A%207%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%209%3B%20oldVal%3A%208%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2010%3B%20oldVal%3A%209%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2011%3B%20oldVal%3A%2010%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2012%3B%20oldVal%3A%2011%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%5Dat
 
   
https://code.angularjs.org/1.2.16/angular.js:78:12https://code.angularjs.org/1.2.16/angular.jsat
 Scope.$digest (
   
https://code.angularjs.org/1.2.16/angular.js:12290:19https://code.angularjs.org/1.2.16/angular.js)
 
   at Scope.$apply 
(https://code.angularjs.org/1.2.16/angular.js:12516:24https://code.angularjs.org/1.2.16/angular.js)
 
   at done 
(https://code.angularjs.org/1.2.16/angular.js:8204:45https://code.angularjs.org/1.2.16/angular.js)
 
   at completeRequest 
(https://code.angularjs.org/1.2.16/angular.js:8412:7https://code.angularjs.org/1.2.16/angular.js)
 
   at XMLHttpRequest.xhr.onreadystatechange (
   
https://code.angularjs.org/1.2.16/angular.js:8351:11https://code.angularjs.org/1.2.16/angular.js
   ) angular.js:9778


   1. Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. 
   Aborting! Watchers fired in the last 5 iterations: [[fn: $locationWatch; 
   newVal: 8; oldVal: 7,savvy; newVal: \Savvy?\; oldVal: undefined],[fn: 
   $locationWatch; newVal: 9; ol...omitted...5D angular.js:78


   1. Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. 
   Aborting! Watchers fired in the last 5 iterations: [[fn: $locationWatch; 
   newVal: 19; oldVal: 18,savvy; newVal: \Savvy?\; oldVal: 
   undefined],[fn: $locationWatch; newVal: 20;...omitted...5D 
   angular.js:78



Should I not be calling path on $location inside the run function? It looks 
like calling path triggers several calls to $digest. I'm reading through 
the source code to understand what I'm doing wrong but I figured someone 
here might beat me to it and give me a good explanation.

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Injecting $location service in config and calling path triggers 10 $digest() iterations reached

2014-05-15 Thread Jeff Hubbard
Let me guess: you've got at least 2 apps that you're bootstrapping, and at 
least 2 of them make use of $location? Because that's a big no-no. I spent 
a few days tracking that down recently. If you really, truly do need to 
write to $location in two apps... then I have no idea. But if all you need 
is read access, then use $window.location instead.

On Thursday, May 15, 2014 9:47:14 PM UTC-7, Mieczysław Daniel Dyba wrote:

 I'm building an app that is composed of several mortgage calculators. Each 
 calculator is a separate route in the app. I'm bootstrapping the angular 
 app so that I can render any number of calculators simply by adding a data 
 attribute to a div tag that points to the correct route.

 Here is a Plunker to show you the gist of how I'm building the app: 
 http://plnkr.co/edit/EAV7j8

 I'm having trouble with injecting the $location service into the run 
 function. These are the errors I'm getting:


1. Error: [$rootScope:infdig] 10 $digest() iterations reached. 
Aborting! Watchers fired in the last 5 iterations: [[fn: $locationWatch; 
newVal: 8; oldVal: 7,savvy; newVal: \Savvy?\; oldVal: 
 undefined],[fn: 
$locationWatch; newVal: 9; oldVal: 8,savvy; newVal: \Savvy?\; oldVal: 
undefined],[fn: $locationWatch; newVal: 10; oldVal: 9,savvy; newVal: 
\Savvy?\; oldVal: undefined],[fn: $locationWatch; newVal: 11; oldVal: 
10,savvy; newVal: \Savvy?\; oldVal: undefined],[fn: $locationWatch; 
newVal: 12; oldVal: 11,savvy; newVal: \Savvy?\; oldVal: undefined]] 

 http://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10p1=%5B%5B%22fn%3…%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%5Dhttp://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10p1=%5B%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%208%3B%20oldVal%3A%207%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%209%3B%20oldVal%3A%208%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2010%3B%20oldVal%3A%209%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2011%3B%20oldVal%3A%2010%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%2C%5B%22fn%3A%20%24locationWatch%3B%20newVal%3A%2012%3B%20oldVal%3A%2011%22%2C%22savvy%3B%20newVal%3A%20%5C%22Savvy%3F%5C%22%3B%20oldVal%3A%20undefined%22%5D%5Dat
  

 https://code.angularjs.org/1.2.16/angular.js:78:12https://code.angularjs.org/1.2.16/angular.jsat
  Scope.$digest (

 https://code.angularjs.org/1.2.16/angular.js:12290:19https://code.angularjs.org/1.2.16/angular.js)
  
at Scope.$apply 
 (https://code.angularjs.org/1.2.16/angular.js:12516:24https://code.angularjs.org/1.2.16/angular.js)
  
at done 
 (https://code.angularjs.org/1.2.16/angular.js:8204:45https://code.angularjs.org/1.2.16/angular.js)
  
at completeRequest 
 (https://code.angularjs.org/1.2.16/angular.js:8412:7https://code.angularjs.org/1.2.16/angular.js)
  
at XMLHttpRequest.xhr.onreadystatechange (

 https://code.angularjs.org/1.2.16/angular.js:8351:11https://code.angularjs.org/1.2.16/angular.js
) angular.js:9778


1. Uncaught Error: [$rootScope:infdig] 10 $digest() iterations 
reached. Aborting! Watchers fired in the last 5 iterations: [[fn: 
$locationWatch; newVal: 8; oldVal: 7,savvy; newVal: \Savvy?\; oldVal: 
undefined],[fn: $locationWatch; newVal: 9; ol...omitted...5D 
angular.js:78


1. Uncaught Error: [$rootScope:infdig] 10 $digest() iterations 
reached. Aborting! Watchers fired in the last 5 iterations: [[fn: 
$locationWatch; newVal: 19; oldVal: 18,savvy; newVal: \Savvy?\; 
 oldVal: 
undefined],[fn: $locationWatch; newVal: 20;...omitted...5D 
angular.js:78



 Should I not be calling path on $location inside the run function? It 
 looks like calling path triggers several calls to $digest. I'm reading 
 through the source code to understand what I'm doing wrong but I figured 
 someone here might beat me to it and give me a good explanation.

 Thanks in advance!


-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Update $scope.variable value after POST

2014-05-15 Thread jay . munjpara
 

I am creating an simple TODO app using AngularJS, i POST the data to server 
when response comes, that response i want to store it existing variable and 
refresh the view. i.e

// This stores on page load, its working fine
var todos = $scope.todos = sever_passed_data;

but when i do,

$scope.$watch('todos', function () {
var request = $http({
method: post,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
url: my_url,
data: $.param({todos_list: angular.toJson(todos)})
});
request.success(function(responce){
var todos = $scope.todos = responce;
});}, true);

after this it gives me weird(*it goes in infinite loop and posting data to 
server*) output, i mean the responce doesn't stores in todos variable.

-- 
You received this message because you are subscribed to the Google Groups 
AngularJS group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.