These are chat archives for AngularClass/NG6-starter

6th
Feb 2016
Andrew Lombardi
@kinabalu
Feb 06 2016 00:54 UTC
how are you guys including font-awesome into your project? I’ve attempted @import ‘~font-awesome/css/font-awesome.min.css’ and then added url-loader to the webpack.config.js but it complains about the module loading
ERROR in ./~/font-awesome/fonts/fontawesome-webfont.ttf?v=4.5.0
Module parse failed: ~/client/node_modules/font-awesome/fonts/fontawesome-webfont.ttf?v=4.5.0 Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/css-loader!./~/font-awesome/css/font-awesome.min.css 6:576-627
Sergey Protko
@fesor
Feb 06 2016 00:56 UTC
You may need an appropriate loader to handle this file type.
there is example of how to configure url/file loaders for fonts
Andrew Lombardi
@kinabalu
Feb 06 2016 00:59 UTC
that was the trick, thanks @fesor!
Andrew Lombardi
@kinabalu
Feb 06 2016 16:05 UTC
what do you guys use for accessing localStorage? I’ve been using ngStorage but having some issues where it errors out with TypeError: Cannot read property 'indexOf' of undefined if I’m trying to check for the existence of a stored variable
ah nevermind, i’m silly
Andrew Lombardi
@kinabalu
Feb 06 2016 16:26 UTC
@fesor i’m trying to include ng-table in my app from a previous angular project, and it seems that webpack really won’t load it. I guess it’s looking for an index.js, or several other types of files but it doesn’t exist
the last bit errors out after finding the directory but unable to do anything:
resolve directory
  directory default file index
    resolve file index in /~/client/node_modules/ng-table
      /~/client/node_modules/ng-table/index doesn't exist
      /~/client/node_modules/ng-table/index.webpack.js doesn't exist
      /~/client/node_modules/ng-table/index.web.js doesn't exist
      /~/client/node_modules/ng-table/index.js doesn't exist
      /~/client/node_modules/ng-table/index.json doesn't exist
Sergey Protko
@fesor
Feb 06 2016 19:19 UTC
@kinabalu it seems to be package.json for ngTable is wrong… you can send PR to authors)
Andrew Lombardi
@kinabalu
Feb 06 2016 22:33 UTC
saw your response in github just now, thanks @fesor. that’s odd indeed. wondering if it might be worth refactoring to use something like ui-grid instead
Sergey Protko
@fesor
Feb 06 2016 22:35 UTC
@kinabalu by looking on github activity, ui-grid is looks a way better than ng-table
p.s. I hate grids in UI)))
Andrew Lombardi
@kinabalu
Feb 06 2016 22:35 UTC
hage?
Sergey Protko
@fesor
Feb 06 2016 22:36 UTC
typo, sorry
Andrew Lombardi
@kinabalu
Feb 06 2016 22:36 UTC
hate?
Sergey Protko
@fesor
Feb 06 2016 22:36 UTC
yep, i prefer lists, multicolumn layouts and stuff. I use grid rarelly if I don’t have any time to think about better UI
i.e. gmail-like
Andrew Lombardi
@kinabalu
Feb 06 2016 22:38 UTC
what i’m attempting to represent is basically excel-like in nature, at least that’s how it’s represented now. it’s a list of accounts with financial numbers throughout
not sure how else I would really represent that
Sergey Protko
@fesor
Feb 06 2016 22:39 UTC
i don’t say you sholdnt use grids, there is a lot of cases when it just fits
Andrew Lombardi
@kinabalu
Feb 06 2016 22:40 UTC
i actually would love to represent this data differently, but I have no clue how that might look really.
like your todo example, the way that was coded up, definitely like that a lot
Sergey Protko
@fesor
Feb 06 2016 22:40 UTC
this is very large topic) I hate when developers just throw all data into big fat grid)
I will cleanup my todomvc a little bit on the next week
to make use some of angualr 1.5 features
Andrew Lombardi
@kinabalu
Feb 06 2016 22:41 UTC
oh fun
i don’t like big fat grids either, but i lack the design / ux chops to really do anythign else sometimes
Sergey Protko
@fesor
Feb 06 2016 22:44 UTC
@kinabalu there is always traid-off
it’s ok)
Andrew Lombardi
@kinabalu
Feb 06 2016 22:45 UTC
i probably need to just hire a talented UX designer to wield some more effective design to my crazy ideas
Sergey Protko
@fesor
Feb 06 2016 22:49 UTC
@kinabalu for many cases it just additional overhead. For example for crud-like control panels.
Andrew Lombardi
@kinabalu
Feb 06 2016 22:49 UTC
@fesor it’s nice though, because you can tell when someone put the extra effort in to a design and the UX behind it
Sergey Protko
@fesor
Feb 06 2016 22:50 UTC
Angular 1.5 landed in NG6-starter
Andrew Lombardi
@kinabalu
Feb 06 2016 22:51 UTC
nice
@fesor i probably need to put together a test or example of this problem I’m having
but if I have a component which is making a Restangular call, and a second component kinda depends on the value returned from that call… is this possible?
Sergey Protko
@fesor
Feb 06 2016 23:08 UTC
@kinabalu promises?
I use uiRouter’s resolvers and try to never get data from components
Andrew Lombardi
@kinabalu
Feb 06 2016 23:08 UTC
@fesor oh, shit… yeah … forgot about that
@fesor refactoring is fun and illuminating so very often
@fesor do you have any examples of doing this? I think I may just google around to see if I find something, or see if it’s in the todo app
Sergey Protko
@fesor
Feb 06 2016 23:14 UTC
todoapp is single screen app… I don’t see how I can add something like that.
I tried to find some more complex applications and didn’t found anything useful
Andrew Lombardi
@kinabalu
Feb 06 2016 23:17 UTC
hrmm bummer, ok
Sergey Protko
@fesor
Feb 06 2016 23:18 UTC
I had a crazy idea of writting UI for jenkins CI in angular))
Andrew Lombardi
@kinabalu
Feb 06 2016 23:19 UTC
that’s … ambitious
but warranted, jenkins CI is quite shitty
Sergey Protko
@fesor
Feb 06 2016 23:20 UTC
no, managing part like jenkins configuration would stay as it is. Only list of jobs, simplify jobs configurations and so on.
but I just had no time for such projects (
Andrew Lombardi
@kinabalu
Feb 06 2016 23:24 UTC
yeah, i know the feeling
@fesor when using resolve, will the object be added to this?
Sergey Protko
@fesor
Feb 06 2016 23:33 UTC
@kinabalu … are you talking about binding values to component controller?
Andrew Lombardi
@kinabalu
Feb 06 2016 23:35 UTC
@fesor yeah, i’d like to use values that are promise based inside the controller and move ‘em out to resolve like had mentioned
Sergey Protko
@fesor
Feb 06 2016 23:37 UTC
.state(’stateName’, {
     resolvers: {
          someData: someDataResolver 
     },
     controller: function ($scope, someData) {
         $scope.$resolves = {someData};
     },
     template: `<my-component some-data=“$resolves.someData”></my-component>`
})
Andrew Lombardi
@kinabalu
Feb 06 2016 23:49 UTC
ahh I thought it was just resolve: { someData: someDataResolver }
and I actually thought using $scope wasn’t really done with NG6-starter
Sergey Protko
@fesor
Feb 06 2016 23:50 UTC
@kinabalu yeah… I hate to use $scope… but uiRouter doesnt support auto-export resolved data to $scope so i need to handle it mannually
maybe in 1.0
ngRoute does it automaticly
Andrew Lombardi
@kinabalu
Feb 06 2016 23:52 UTC
ngRoute is a bit more painful to use though, no? that’s why everyone kinda defers to ui-router
Sergey Protko
@fesor
Feb 06 2016 23:53 UTC
well… it just doesn’t support nested views which makes uiRouter defacto stanrad solution
there is also angular-router, which should be cool… but I didn’t tried it yet
Andrew Lombardi
@kinabalu
Feb 06 2016 23:55 UTC
@fesor is it possible to inject a service into the resolver flow? ordinarily I’d obviously have a class and use “ngInject”; in the constructor
Sergey Protko
@fesor
Feb 06 2016 23:55 UTC
yes
resolves: {
    someData: function(someService) {
         return someService.getSomeData();
    }
}
Andrew Lombardi
@kinabalu
Feb 06 2016 23:56 UTC
ahh and would you use “ngInject” within the function, or is it done automagically?
Sergey Protko
@fesor
Feb 06 2016 23:57 UTC
well… can’t tell you) I just add ”ngInject” always)
just to be sure)
Andrew Lombardi
@kinabalu
Feb 06 2016 23:57 UTC
haha