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

19th
Jul 2016
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 06:54
@All
can any one help me in this,
i want to load and store the users current location from the browser , how to achieve this in angular 2 typescripts.?
Dominik Gätjens
@dcg
Jul 19 2016 06:55
easy,hackish without typesafty : window.location ;)
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 06:55
will it load geolocation ?
Dominik Gätjens
@dcg
Jul 19 2016 06:57
no it will get you the window.location object the actual url, etc. i think i miss understood you, u want to load the devices geolocation?
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 06:58
yeah
i want to fetch the current location lat long
Dominik Gätjens
@dcg
Jul 19 2016 07:01
well, have you tried the standard way like window.navigator.geolocation.getCurrentPosition(callback) ? i dont see no reason why this shoudn't work. i would encapsulate this in a service so you can mock it easyly in unit-tests. Be aware that afaik chrome supports this only with HTTPS
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:03
actually I am totally new to angular.
i tried ng2-location
not worked for me
Dominik Gätjens
@dcg
Jul 19 2016 07:04
there is no magic invovled ;) in the end its just javascript. Things only get tricky if you want/need typesafty for plain javascript stuff, and if you need to mock stuff for testing
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:06
exactly here i face difficulty, java script code in typescripts for angular confused :-(
<script> tag is not working in html template
how to add java scripts
Dominik Gätjens
@dcg
Jul 19 2016 07:09
npm install
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:12
npm install yes i did
Dominik Gätjens
@dcg
Jul 19 2016 07:13
than it should get build into your vendor.js pacakge
and that should be automaticly included in your index.html
that are the features of webpack ;)
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:15
please can you share any link to guide me
Dominik Gätjens
@dcg
Jul 19 2016 07:16
are you using the angular2-webpack-starter? https://github.com/AngularClass/angular2-webpack-starter
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:18
no
Dominik Gätjens
@dcg
Jul 19 2016 07:18
ok :D this is the gitter for this project ;)
just cone the repo
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:19
okay
Dominik Gätjens
@dcg
Jul 19 2016 07:19
type "npm start" and you have a good sample project
Jyothi lakshmi R
@Jyothi406
Jul 19 2016 07:19
thank you
:-)
Dominik Gätjens
@dcg
Jul 19 2016 07:19
you're welcome ;)
binarious
@binarious
Jul 19 2016 09:47
Is anyone successfully running unit tests with the new Forms API and angular2-webpack-starter? It does not work for me (AngularClass/angular2-webpack-starter#791).
Tony Xavier
@vinzandtonz
Jul 19 2016 12:09
Can anybody help me to get the values of the next and previous route information in canDeactivate guard in new router ?
aider
@aider_twitter
Jul 19 2016 14:25
Anybody know how to update angular2-webpack-starter in exising project?