Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mike Haas
@mikehaas763
:) Either you mistype with an uppercase or you mistype with a lowercase
Dave Ackerman
@dmackerman
anyone played around with the new ngAnimate in 1.4rc?
Adrian Mitev
@amitev
hi all. is it true that if i store a directive element inside the scope, angular will traverse all the html tree because its referenced by that element?
Louis Larry
@louislarry
hello
is there any comparable way in angular-new-router to do $state.go
Louis Larry
@louislarry
$router.navigate('url') did not work for me
my workaround is to now use $location.path('/url')
Dave Ackerman
@dmackerman
going to play around with 1.4rc this morning and see what breaks :)
maryam
@maryampashmi
This message was deleted
Bhargav Gandhi (BG)
@bhargavgandhi
Hi, any one knows any CMS works on angularJS or has frontend of angularJS ? thanks.
Patrick Heneise
@PatrickHeneise
Anyone from Europe here? There's an Angular 2 special event with 3-4 talks on Saturday, June 20, just before Mediterr√°neaJS http://mediterraneajs.eu
Quinntyne Brown
@QuinntyneBrown
@jvandemo We should have a working child router once this ticket is closed angular/router#267
Jurgen Van de Moere
@jvandemo
@QuinntyneBrown Excellent, just added my vote to your issue. :+1:
Kanin Peanviriyakulkit
@dogrocker

hello, Need some help with push() ! I've got

$scope.category = {
    name : '',
    id : ''
  };

but my data is return in object like

Object {name: "Room6", createdAt: "2015-04-29T08:49:33.777Z", updatedAt: "2015-04-29T08:49:33.777Z", id: "55409b1d548bf379531623d9"}

I try to push like $scope.category.push(sailsResponse.data);

but angular error like this TypeError: $scope.category.push is not a function

Oh my misstake sorry I got it.
Kanin Peanviriyakulkit
@dogrocker
Can I define something this ?
<html ng-app="OneModule" ng-controller="OneController" ng-cloak>
<div class="row" ng-app="TwoModule" ng-controller="TwoController" ng-cloak>
</div>
</html>
Kanin Peanviriyakulkit
@dogrocker
Hello, I'm use angular with sails my link is like this.
generate by angular
<a href="{{ cate.id }}">{{ cate.name }}</a></td>
when I click link how angular know the ID parameter?
help pls.
Dave Ackerman
@dmackerman
ng-click=“goToSomething(cate)"
in your controller, do something with cate.id
Carl von Buelow
@cvbuelow
anyone know approximately when 1.4 stable will be released?
Paulo Oliveira
@poliveira89
:+1: ^^
Tim Jacobi
@timjacobi
So Angular 1.4 is out but I can't find the module.component function. Was that moved to 1.5?
Jeff Whelpley
@jeffwhelpley
Brian Ford gave a talk at the Boston Angular Meetup last night on the ComponentRouter (new name for the new router in 1.4/1.5/2.0): https://www.youtube.com/watch?v=sfV0ApyN5fM
Tim Jacobi
@timjacobi
This message was deleted
Mike Haas
@mikehaas763
If I run karma start, isn't it supposed to do a test run once the server starts?
Mike Haas
@mikehaas763
Well, It turns out the autoWatch karma config property is what determines whether karma start will do an initial test run. I didn't realize that. It's been wayyy to long since I've used karma.
Neel
@neelneelneel
Hi, I finally need to start testing my angular app. Any helpful tutorials or videos that you would recommend?
Brad Wertman
@bmwertman

I have a state in my ui-router app.manage. I specify a controller: 'ManageCtrl' in that parent state.

The parent state has three child views. One of which week: {templateUrl:'manage/templates/week.html' operates under a different controller , CalendarController

I've created a factory weekDatesService and injected it into my CalendarController

and set a resolve: { dates: function (weekDatesService) { return weekDatesService.getWeek(); } on the parent app.manage state.

and then I inject dates, which my factory should return, in my ManageCtrl.

I keep getting an error in my console Error: [$injector:unpr] Unknown provider: weekDatesService

I've done this before between top level parent views without problems but I'm not sure what I'm missing doing it with child views within a state.

Kyle Bradshaw
@kylebradshaw
Hi, I have a quick question. what is the best way to automatically select the first value when using ng-options in a <select>? tried a couple things from SO but didn't end up working for me. I'm on 1.3.15
Mike Haas
@mikehaas763
@kylebradshaw Maybe using ng-model set the initial value for the select to be bound to?
Kyle Bradshaw
@kylebradshaw
I've tried this approach
    <select id="behaviors"
        ng-model="selectedBehaviors"
        ng-change="selectBehaviorAction()"
        ng-options="value.behavior for value in data | orderBy:'behavior'"
        ng-init="selectedBehaviors = data[0].value"
        >
    </select>
but the ng-init isn't working in this case
Mike Haas
@mikehaas763
I don't use ng-init because it's a bad practice in real world apps so I can't be sure but I'm guessing when the ng app bootstraps and the ng-init is evaluated once, that the data array does not yet exist.
@kylebradshaw I just found this post that explains it a bit better http://stackoverflow.com/a/27909326/1454406
Kyle Bradshaw
@kylebradshaw
@mikehaas763 awesome this is a great approach, thanks a lot!
Matt Prestlien
@mattchue
Hello! Quick question - as I'm scaling my app up, I want to separate out my controllers into their own .js files. It seems like unless i use something like gulp-concat then my only option is to include every individual controller in a <script> tag in my index.html. For large apps, this could mean you have hundreds of potential script includes. Am I missing something here?
Mike Haas
@mikehaas763
@mattchue There are three options that I can think of. 1 use a module system that takes care of loading the individual script files. 2 concat everything into a bundle as you mentioned. You still need to make sure you load things in the right order though. For example, make sure you order your angular.module('mod', []) defines before angular.module('mod) reads. 3 use a tool like gulp-linker to help automate the insertion of script tags. You still have to make sure you load your module defines before the reads.
Matt Prestlien
@mattchue
@mikehaas763 that helps a ton. the only module loader that i'm aware of is AngularAMD, which still required individual script declarations, just via javascript instead of html. additionally, i know gulp-concat can sweep through folders and find script files so you don't have to try and define them all yourself. I will definitely check out linker as well. Thanks!
Mike Haas
@mikehaas763
@mattchue I wouldn't use that AngularAMD package personally. I believe the point of that is to allow lazy loading of modules. I mean a module system as in RequireJS, browserify, webpack, or native ES6 modules transpiled and loaded using SystemJS.

Yes using something like gulp-concat or gulp-linker automatically finds files but you have to tweak something generally so that the files that define your angular modules are loaded before other files that add things such as controllers or directives to the angular modules.

For example

//file1.js
angular.module('myMod', []);

//file2.js
angular.module('myMod').controller('myController', MyControllerConstructor);
Brad Wertman
@bmwertman
I'm using $scope.$on to listen for an event object. I'm able to console.log() the data I need inside the $scope.$on callback function. But if I return data outside the callback and try to console.log there it's undefined. Can someone explain?
Mike Haas
@mikehaas763
One thing I've done on past teams is made the files that defined the modules named 00-module.js etc. The gulp.src, gulp-concat etc loads them in the correct order just based on the file name. There are other ways you could automate this though.
@bmwertman Can you make a small snippet or gist or something for an example?
Brad Wertman
@bmwertman
@mikehaas763 Yes, one sec.
Brad Wertman
@bmwertman
Mike Haas
@mikehaas763
@bmwertman so I'm guessing you're saying you can console.log(datesInView) when you're inside the $scope.$on callback?
Brad Wertman
@bmwertman
@mikehaas763 , correct
But I need to be able to use the data returned in the callback outside $scope.$on in my ManageCtrl
Mike Haas
@mikehaas763
So what's happening is you're experiencing the asynchronous and closure nature of javascript. Inside this controller, you call two statements. $scope.$on() and console.log(). Those two statements get invoked synchronously one time when the controller is first instantiated... (I have more)