Re: [AngularJS] Controllers as classes - constructor prototypes and models

2014-04-28 Thread Tony pee
I dont think it really matters that they are revealed, but if you prefer to use the controller like a factory: mod.controller('myCtrl', function($scope, $service1, $hat, $cat) { function MyCtrl() { //init }; MyCtrl.prototype.onSomething = function() { $hat.color = 'red'; }; retu

Re: [AngularJS] Controllers as classes - constructor prototypes and models

2014-04-28 Thread divisivecottonwood
It does make perfect sense. I was just wondering if there was a way of using services without assigning it as a property to the controller, like below but cleaner Also, why aren't angularjs services like $log exposed to the template? var app = angular.module('myApp'); var _Ctrl; var Ctrl = f

Re: [AngularJS] Controllers as classes - constructor prototypes and models

2014-04-28 Thread divisivecottonwood
It does make perfect sense. I was just wondering if there was a way of using services without assigning it as a property to the controller. I suppose: var app = angular.module('myApp'); var _Ctrl; var Ctrl = function($rootScope, $log, $timeout, aService, CONFIG) { this.$rootScope = $rootScop

[AngularJS] Re: Call $http from controller

2014-04-28 Thread Gordon Bockus
The thing that you will run into is if you make http calls from your controller then it is more painful to write unit tests. If you use a service there is a lot less overhead in mocking that service response then in spying on $http. On Monday, April 28, 2014 10:29:04 PM UTC-5, Rajesh wrote:

[AngularJS] Re: Need help badly

2014-04-28 Thread Ronneil Camara
Thank you so much!!! I also was able to get NodeJS parsing my query string. I'm going to look at your codes now. On Monday, April 28, 2014 11:00:40 PM UTC-5, johntom wrote: > > see my https://github.com/johntom/crmMeans repo and you can view > http://sample4.gtz.com:8001/home without a logon. Ha

Re: [AngularJS] Controllers as classes - constructor prototypes and models

2014-04-28 Thread Tony pee
the 'controller as' feature simply adds your controller 'as' a variable on the $scope, so that you can reference it. This means that you can set values to the controller via 'this.myVar = xxx' and then reference them as myCtrl.myVar in the template. (where you have set ng-controller="SomethingCtrl

[AngularJS] Re: Need help badly

2014-04-28 Thread johntom
see my https://github.com/johntom/crmMeans repo and you can view http://sample4.gtz.com:8001/home without a logon. Hard to use plnkr with node unless you create a rest server. HTH John On Monday, April 28, 2014 11:12:57 PM UTC-4, Ronneil Camara wrote: > > Good evening folks, > > Does someone hav

[AngularJS] Re: Call $http from controller

2014-04-28 Thread Yusuf Alii
As a rule of thumb, if you want to re-use your functionality in different controllers then you should create it as a service instead of hard coding in one controller. This would minimize code redundancy and make your app more modular. On Tuesday, April 29, 2014 8:59:04 AM UTC+5:30, Rajesh wro

Re: [AngularJS] Re: Yet Another IE9 Compatibility Problem

2014-04-28 Thread Alesei N
correct me if I am wrong, if you load */v2/challenges/new* in ie9, you get base route resolution in angular app right? instead of */v2/challenges/new* you get default page loaded right? On Mon, Apr 28, 2014 at 9:20 PM, Yale Kaul wrote: > That mostly makes sense to me. > > The part I'm still con

[AngularJS] Call $http from controller

2014-04-28 Thread Rajesh
Can I call a REST api using $http directly in my controller? When would I need to create my own service vs using $http service from controller? Most of the examples on the web just call $http in a custom service. -- You received this message because you are subscribed to the Google Groups "Ang

Re: [AngularJS] Routing not working

2014-04-28 Thread Yusuf Alii
Thanks so much Zoltan, it totally works! but somehow the *contact* view still doesn't works. Any idea why? cheers once again On Monday, April 28, 2014 11:51:02 PM UTC+5:30, Zoltan Szalai wrote: > > in your controllers you want to GET your module and not SET it, so in > your three controllers c

[AngularJS] Need help badly

2014-04-28 Thread Ronneil Camara
Good evening folks, Does someone have a plunkr of a simple form containing fields like name, age, birthday, etc written in AngularJS and submits it to a NodeJS server? Any help would be greatly appreciated! Thanks! Neil -- You received this message because you are subscribed to the Google Gr

Re: [AngularJS] foreach

2014-04-28 Thread Jose Luis Rivas
that depends on the server you are doing the query to, not angular. On 4/28/14, 9:44 PM, T M wrote: > hi, I wander, for a collection returned from a query (ex: $http query). > I can use angular.foreach to loop over the multiple records. > > Is there any way to exactly get one single record? For e

[AngularJS] foreach

2014-04-28 Thread T M
hi, I wander, for a collection returned from a query (ex: $http query). I can use angular.foreach to loop over the multiple records. Is there any way to exactly get one single record? For example I made the query by specifying the primary key. I will get exactly one single returned record. On th

Re: [AngularJS] Re: Yet Another IE9 Compatibility Problem

2014-04-28 Thread Yale Kaul
That mostly makes sense to me. The part I'm still confused about is 1.2. I'm able to make the server redirect to */#/v2/challenges/new* for IE9, but how will Angular know to do the same thing at */#/v2/challenges/new* and */v2/challenges/new* (no hashbang)? In other words, I load */v2/challe

Re: [AngularJS] File uploads...

2014-04-28 Thread Jose Luis Rivas
ng-model does not work for input(type=file) by default. I made this angular directive for it: https://github.com/ghostbar/angular-file-model (There's this factory too for uploading with easy ways to put new names to files and stuff which is compatible with angular-file-model as well https://githu

[AngularJS] Re: Routing not working

2014-04-28 Thread Billy Figueroa
You usually do that in the app.js file var app = angular.module('app', ['ngRoute'] ); in app js then you can do app.config app.controller etc through out the entire application On Monday, April 28, 2014 1:18:43 PM UTC-4, Yusuf Alii wrote: > > I'm new to Angularjs and have been learning about

[AngularJS] File uploads...

2014-04-28 Thread Billy Figueroa
Hey fellas, So I already had this previously working when using normal form submission but when I switched this code over to angularjs the files selected are not being picked up. Here is my html Bio

[AngularJS] Re: Unit Testing in Rails. Lost.

2014-04-28 Thread george Norris
Most of the questions in this group asking simular questions go answered. I hope someone can help with this. Thanks. On Monday, April 28, 2014 1:51:40 PM UTC-7, george Norris wrote: > > Hello. I am new to Angular but somewhat experienced with Rails. > > I'm having the tough time getting Jasmine

[AngularJS] Unit Testing in Rails. Lost.

2014-04-28 Thread george Norris
Hello. I am new to Angular but somewhat experienced with Rails. I'm having the tough time getting Jasmine unit tests set up with Angular / Rails. Previously, I've worked with Backbone and Jasmine so I have some experience with Jasmine and setting it up. Please tell what I am doing wrong.

[AngularJS] Re: Restangular - extending model when using your own model layer

2014-04-28 Thread Matt Williams
check this out: http://blog.shinetech.com/2014/02/04/rich-object-models-and-angular-js/ restangular includes a method called extendModel that lets us decorate > models returned from particular routes with additional behaviour. > ExendModel will allow you to decorate your User model with what

[AngularJS] Controllers as classes - constructor prototypes and models

2014-04-28 Thread divisivecottonwood
I've been experimenting with different code design patterns in my controllers and services My starting point was Josh Carroll's 5 Guidelines For Avoiding Scope Soup in Angular [http://www.technofattie.com/2014/03/21/five-guidelines-for-avoiding-scope-soup-in-angular.html] As an example of a co

Re: [AngularJS] Routing not working

2014-04-28 Thread Zoltan Szalai
in your controllers you want to GET your module and not SET it, so in your three controllers change var app = angular.module('app', ['ngRoute'] ); to var app = angular.module('app'); On 2014.04.28. 19:18, Yusuf Alii wrote: I'm new to Angularjs and have been learning about routing. I created

[AngularJS] Routing not working

2014-04-28 Thread Yusuf Alii
I'm new to Angularjs and have been learning about routing. I created a test application for routing but somehow it doesn't works! I have thoroughly checked all the official documentation and tried different combinations but not been able to make it work yet Here is the code: http://plnkr.co/edi

[AngularJS] Android browser support

2014-04-28 Thread mtricot
Hello, I would like to know which Android browser versions are supported in AngularJS 1.2 and 1.3? The FAQis not really precise about that. Thanks, Mickaël -- You received this message because you are subscribed to th

[AngularJS] Re: no way to test key event handling directives

2014-04-28 Thread Kamal
Mark, As far as i know its best to use protractor for event based testing instead of karma. On Monday, 28 April 2014 02:01:29 UTC+5:30, Mark Volkmann wrote: > > I have a directive that limits the allowed keypresses in an input to > digits and navigation

Re: [AngularJS] Re: Render different layout views

2014-04-28 Thread Billy Figueroa
I was watching the video over a few days as you mentioned this. Its good to know some others are taking or have taken the same path I m going through On Saturday, April 26, 2014 12:28:21 AM UTC-4, Richard Seldon wrote: > > Hi Billy, yeah, that’s a good read too! Didn’t read it front to back, but

[AngularJS] Re: Problem with fetching Facebook ETag from $http response

2014-04-28 Thread Elia Bruni
Dear Sander, Thank you very much, sometimes things are just in front of my nose :-) Best, Elia On Monday, April 28, 2014 5:55:34 AM UTC+2, Sander Elias wrote: > > Hi Elia, > > I have no experience with this openFB module, I just read the source now. > openfb.get is just doing an $http call, so

[AngularJS] Re: [ng-grid] Only one selectedItem array populated

2014-04-28 Thread johntom
Try creating a plnkr to show problem and you will have a much better chance of a reply and solution. HTH John On Sunday, April 27, 2014 11:24:18 AM UTC-4, David Edwards wrote: > > I have two ng-grids setup in one controller for my page. The second grid > is populated based off a selection from t

[AngularJS] Re: Creating service with $http and $q promise (and parameters)

2014-04-28 Thread Meynard Soriano
Is this still applicable at version 1.2.16? Thanks. On Thursday, September 13, 2012 12:53:33 AM UTC+8, Uri Goldshtein wrote: > > Hi, > >I've created a service that calls $http (not $resource) and to get the > value to the controller. >It took some time and i found a lot of example but not

[AngularJS] Re: Pass a variable from a http call to another

2014-04-28 Thread Charlie Camus
Thanks to all, I will follow your advices and try to learn some more about the 'promises'. Thanks Le vendredi 25 avril 2014 17:12:03 UTC+2, Charlie Camus a écrit : > > Hi all, > > I'm a beginner with Angular JS, and I think I missed something. > > Here is my code : > > $scope.listAccueil=functio

[AngularJS] Custom Directive data binding issu

2014-04-28 Thread Diwan Oli M
Hi , I have implemented custom directory jquery auto-complete . this directory when the page load that is automatically bind , that time i dont have the value , when i click the getData button that data will come from server. that data is not loading in my auto complete text box can a