These are chat archives for AngularClass/NG6-starter

4th
Feb 2016
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 13:51
This message was deleted
This message was deleted
Is there a good example of how to use $watch with es6?
Sergey Protko
@fesor
Feb 04 2016 14:01
@icylabsDev yes, just don’t $watch
can you provide usecase why you even need something to $watch in controller?
dror
@i-am-dror
Feb 04 2016 14:02
how can i import bootstrap-stylus instead of bootstrap.css?
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 14:04
hehehe, well I need to get a theme (REST call), after I catch a course (REST call) . How do I make it wait for the Promise to resolve?
the Theme is a child of the course
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 14:09
is there a way I can stop the directive from rendering before the course gets populated?
Sergey Protko
@fesor
Feb 04 2016 14:10
ngIf
and .then in promises
<my-stuff-viewer stuff=“vm.stuff” ng-if=“vm.stuff”></my-stuff-viewer>
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 14:11
ok so the constructor for that directive will only fire when the ng-if is resolved?
Sergey Protko
@fesor
Feb 04 2016 14:11
yep
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 14:11
nice !
Sergey Protko
@fesor
Feb 04 2016 14:11
ngIf will totally remove directive from DOM and will add it only if value is positive
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 14:12
works like a charm
^^
thanks
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:32
I'm trying to plug this module into my app (http://kamilkp.github.io/angular-sortable-view/#?tab=7) but I think it is not commonJS module. I get an error Argument 'module' is not a function, got Object is there a way I can make compatible?
Andy Brown
@brownish
Feb 04 2016 15:33
how are you injecting it into your angular.module?
sometimes it works to just import the 3rd party app at the top then inject it into your module with the string name like you would normally
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:35
import Sortable from 'angular-sortable-view'

angular.module('app', [Sortable])
I tried with Sortable.name I get undefined instead of object in the rror above
Andy Brown
@brownish
Feb 04 2016 15:37
thats because its not exporting like a commonjs module
try adding 'angular-sortable-view'
instead of Sortable
still import it the same
import Sortable from 'angular-sortable-view'

angular.module('app', ['angular-sortable-view'])
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:38
perfect
Andy Brown
@brownish
Feb 04 2016 15:38
it worked?
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:38
yes
Andy Brown
@brownish
Feb 04 2016 15:38
shit yeah nice
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:38
hehe
Andy Brown
@brownish
Feb 04 2016 15:38
lol im still figuring all this out as well haha
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:38
yeah I'm new also
but we'll get there
thanks for the help
Andy Brown
@brownish
Feb 04 2016 15:39
anytime
i've beaten my head against many angular starters and boilerplates but this one is the best
this setup really helped me start to understand javascript more than any other
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:40
yes I do agree
def
Andy Brown
@brownish
Feb 04 2016 15:40
i was using generator-angular-fullstack
but that was some sort of sorcery to me lol
way too confusing
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:40
they are a bit overwhelming
haha
Andy Brown
@brownish
Feb 04 2016 15:40
webpack is so great
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:40
=)
Andy Brown
@brownish
Feb 04 2016 15:41
webpack, and es6 is my jam now
although im still garbage at it
Diogo Afonso Barroso
@icylabsDev
Feb 04 2016 15:43
yeah I was doing it the "old" way, this is way more fun webpack and es6
defenitly
Andy Brown
@brownish
Feb 04 2016 15:43
for sure