These are chat archives for AngularClass/angular2-webpack-starter

26th
Jan 2016
Branko Ilic
@brankoiliccc
Jan 26 2016 12:06
hey guys. I` have cloned angular2-webpack-starter , but when i run npm install i get error
'cp' is not recognized as an external or internal command, operable program or batch file
any idea whats causing this error?
Sam Jones
@ollwenjones
Jan 26 2016 15:32
@brankoiliccc what OS are you on? Windows, I assume?
Branko Ilic
@brankoiliccc
Jan 26 2016 16:58
Hello sorry was afk yeah win 10
Branko Ilic
@brankoiliccc
Jan 26 2016 17:06
Guess this is starter for linux right? Do you happen to have win version maybe ^_^ btw i am having such a hard time putting my angular2 app together for production. I will probably switch to thymeleaf+jquery for my spring boot app. Coming from Java background i just cant figure out why is simple import and packaging so complicated. Instead improving my coding skills and finding better solutions for problems i have spent better part of the last week just trying to bundle my js files into one... kinda silly if you ask me. Not that i dont appreciate the effort you guys put. It just the thing with most javascript frameworks. Way more complicated and messy than it needs to be.
Sam Jones
@ollwenjones
Jan 26 2016 17:17
@brankoiliccc have you been doing 'npm' install on your windows box successfully in other projects? I think it's pretty common to install the linux commands (cygwin) when installing git on windows, which should take care of the 'cp' problem. It's a general npm / command line on windows problem though, not one with this seed project.
if you google your 'cp' error, you should be able to find a few workarounds
I would say that if your production app has a fairly short release schedule, though, angular 2 would be kind of risky, as so much is still changing.
For a short-term production app I would suggest Angular 1.x or React.
Branko Ilic
@brankoiliccc
Jan 26 2016 17:39
@ollwenjones Well i havent had problems with npm install before. Anyways i am gonna give it a try on another machine with Linux on it. Release schedule is not the problem. Problem is Angular2/typescript/react/weback are all new concepts for me so i wanted to make it as simple as possible. Bundle everything with webpack, reference from my spring boot template and have everything run all together with mvn spring-boot:run command. Keep it as simple as possible. I must admit my angular2 knowledge is limited so at every step of the way i need to check is everything still working or did i make a mistake, even for the simplest things.
Sam Jones
@ollwenjones
Jan 26 2016 17:40
I hear you... All pretty new to me as well, which is why I'm thankful for folks like are on here. ;) Maybe double-check your node/npm versions are up to date with what this project specified?
Branko Ilic
@brankoiliccc
Jan 26 2016 17:47
yeah will do. Probably gonna take a break and clear my mind. Had too much coffee :)
Sam Jones
@ollwenjones
Jan 26 2016 17:47
been there too.
Jason Miazga
@jmiazga
Jan 26 2016 18:02
were having troubles adding underscore to the project, is there an example to get this to work?
Sam Jones
@ollwenjones
Jan 26 2016 18:13
I thought I had added momentjs successfully, but I guess not now that I actually tried to use it.
Jason Miazga
@jmiazga
Jan 26 2016 18:15
we installed underscore and its typings, but cant successfully use it
Sam Jones
@ollwenjones
Jan 26 2016 18:17
I had added lodash and open layers to a previous version of this seed, but it was for a proof of concept and seemed kind of hackneyed:
var _ = require('../../../node_modules/lodash');
var ol = require('../../../node_modules/openlayers');
Jason Miazga
@jmiazga
Jan 26 2016 18:17
i dont like the relative paths and the reference to the node_modules folder
is there a cleaner way to do it? i saw a custom._typings.d.ts was added at one point, do I need to do something with that also?
Sam Jones
@ollwenjones
Jan 26 2016 18:18
right. hackneyed, like I said.
Jason Miazga
@jmiazga
Jan 26 2016 18:22
any way we can get a working example of a 3rd party library?
Jason Miazga
@jmiazga
Jan 26 2016 18:35
so i got it to work with the latest version of the template
i think something in my tsconfig was causing problems
Sam Jones
@ollwenjones
Jan 26 2016 18:35
what was the change?
I noticed the default setup + atom editor means atom rewrites the 'files' section of the tsconfig.json all the time
Jason Miazga
@jmiazga
Jan 26 2016 18:38
filesglob was different. it didnt include "typings/browser.d.ts"
Sam Jones
@ollwenjones
Jan 26 2016 18:43
Do you know why we have those 'typings' in the tsconfig.json, and also have typings.json? (new to TypeScript here)
Jason Miazga
@jmiazga
Jan 26 2016 18:52
typings.json are the typescript definitions, so what atom uses for intellisense, the tsconfig.json is for the typescript compiler
Sam Jones
@ollwenjones
Jan 26 2016 18:54
seems like that would manage the stuff in the typings folder based on what's in the typings.json
Jason Miazga
@jmiazga
Jan 26 2016 19:03
you are correct. if you run 'typings install' it reads from typings.json to install the corresponding typings
Sam Jones
@ollwenjones
Jan 26 2016 19:04
then in your app you were able to import { _ } from 'underscore'; ?