These are chat archives for angular/angular-2-ionic-2

22nd
Apr 2017
Z3roCoder
@Z3roCoder
Apr 22 2017 12:12
Is it possible to create SubPages of a Page? In terms of: ionic g page admin && ionic g page admin/overview > Resulting in a Page 'admin', but containing a sub folder 'overview' which I can make the page 'admin' automatically navigate to?
To make it clear - there are several roles in my application, and each role has their own set of views. Currently, I have it like 'admin-overview','admin-userlist','user-overview' etc all in the same folder 'pages'
Miroslav Kaspar
@kasp1
Apr 22 2017 13:37
Anyone looking for an open source project to contribute to? I've got an interesting one with growing user base. Chat me in case. :)
io:r//us
@oxitech239
Apr 22 2017 14:30
@kasp1 what are you on about ?
Miroslav Kaspar
@kasp1
Apr 22 2017 14:31
Gledson Afonso
@GledsonAfonso
Apr 22 2017 17:06
@kasp1 What are the requirements to participate? In expertise, I mean.
Miroslav Kaspar
@kasp1
Apr 22 2017 17:10
Just trying to use it and giving feedback is valuable
Gledson Afonso
@GledsonAfonso
Apr 22 2017 18:05
Sorry, wrong group. :smile:
Tom McKearney
@tommck
Apr 22 2017 18:30
hey all, a bit new to ionic dev. I want to have a self-contained CRUD app in ionic2 that reads/writes from the local file system (android to start). I'm having trouble figuring out how I should be doing this. I assume I should be using ionic-native file stuff, but I'm having a hard time finding a decent example online. Anyone have any ideas/tips?
Tom McKearney
@tommck
Apr 22 2017 18:44
right now, I'm doing this:
    constructor(private file: File) {
this.file.getDirectory(this.file.dataDirectory, dirName, { create: true })
.then(dir => {
but I'm getting an error on this.file.dataDirectory because it wants a DirectoryEntry
I just want to create a folder under the dataDirectory, but I can't figure out how to get a DirectoryEntry from the dataDirectory
(and I only want to create if it doesn't exist)
tommck @tommck hears crickets
Nelson Bwogora
@nelsonBlack
Apr 22 2017 20:52
@tommck ionic documentation is done so well and comes in handy always check https://ionicframework.com/docs/native/file/ this.file.checkDir(this.file.dataDirectory, 'mydir').then(_ => console.log('Directory exists')).catch(err => console.log('Directory doesnt exist'));
Tom McKearney
@tommck
Apr 22 2017 20:53
I have read all that content
checkDir takes 2 strings, yes
but getDirectory() takes a DirectoryEntry and a string
It just seems strange that I can't "createIfNotExist" on a directory
Nelson Bwogora
@nelsonBlack
Apr 22 2017 20:59
Tom McKearney
@tommck
Apr 22 2017 20:59
createDir throws an error if the directory exists.
so I have to checkDir, then createDir, but neither allows me to get a DirectoryEntry from it
well, createDir does
but if I have an existing directory, I can't get a DirectoryEntry, which is just weird
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:04
just a moment i recreate this scenario on my side
Tom McKearney
@tommck
Apr 22 2017 21:07
be right back
Tom McKearney
@tommck
Apr 22 2017 21:16
I'm back :)
all, apparently my old-assed computer can't run the android emulators. Can I test/run/debug directly on the device with ionic2?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:28
yes you can
ionic run android
Tom McKearney
@tommck
Apr 22 2017 21:29
yeah.. for some reason my tablet isn't being recognized by windows
I connect USB.. it just starts charging.. ooh.. might be just a charging cable
ha.. that was it
really cheap charging-only cable.. no comms :)
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:31
if the cable charges it can be used
Tom McKearney
@tommck
Apr 22 2017 21:31
no.. it can't :)
there are many wires in a usb cable.. this one only had a couple connected
literally a charging-only cable
I used another cable and it's fine
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:32
oh okay
Tom McKearney
@tommck
Apr 22 2017 21:32
now I get
Error: No emulator images (avds) found.
2. Create an AVD by running: "C:\Users\tom\AppData\Local\Android\sdk\tools\android.bat" avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:33
you need to install an android emulator
Tom McKearney
@tommck
Apr 22 2017 21:33
I mentioned before that I can't run the emulators because of my cpi
cpui
you told me to do "ionic run android" to run on my connected android device..
I'm guessing there are some steps missing?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:35
before ionic run android do corodva platform add android
Tom McKearney
@tommck
Apr 22 2017 21:35
but tries to run the emulator
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:35
ionic build android
Tom McKearney
@tommck
Apr 22 2017 21:35
I don't have to do anything to tell it to connect to my android tablet to test?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:37
build android will make the apk then you transfer the apk to android device and install it
Tom McKearney
@tommck
Apr 22 2017 21:37
ah, I see.. isn't auto-deployed there?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:37
autodeploy is there if you had a working usb cable connected
Tom McKearney
@tommck
Apr 22 2017 21:38
I do
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:39
then just connect , enable developer options on device and do ionic run android
Tom McKearney
@tommck
Apr 22 2017 21:40
ah.. just enabled developer options.. trying again
nope.. tried emulator again :(
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:41
Tom McKearney
@tommck
Apr 22 2017 21:41
yeah, I missed something
there it is!
sweet.. thanks
wish I knew why Android Studio thought my CPU doesn't have hardware virtualization support (it does and it's enabled)
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:47
recreated the scenario on my side
worked
Tom McKearney
@tommck
Apr 22 2017 21:48
what worked?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:48
creating a directory
but used this.file.createDir(this.file.externalRootDirectory, 'mydir', true); externalRootDirectory refers to the internal sdcard file system which is not private ,
Tom McKearney
@tommck
Apr 22 2017 21:52
right, but if the directory already exists and you don't want to overwrite it, there does not seem to be a way to just GET the DirectoryEntry
Nelson Bwogora
@nelsonBlack
Apr 22 2017 21:57
this.file.checkDir(this.file.externalRootDirectory, 'mydir')
.then(_ => //do stuff console.log('Directory exists'))
.catch(err => console.log('Directory doesnt exist'));
Tom McKearney
@tommck
Apr 22 2017 21:57
this does NOT get me a DirectoryEntry
Tom McKearney
@tommck
Apr 22 2017 22:08
it's alright.. I hacked around it, but that API is really strange
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:11
great , you can check out this repo https://github.com/driftyco/ionic-conference-app ..a full feature app and great starting point created by ionic guys, has helped me a lot too
Tom McKearney
@tommck
Apr 22 2017 22:15
is that ionic1 or 2?
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:20
actually its ionic 3
Tom McKearney
@tommck
Apr 22 2017 22:20
O_o?
ahh... android emulator only supports AMD virtualization in LInux.. grrr
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:23
no much big difference between ionic 2 and 3, ionic 3 added improvements on ionic 2 for faster smaller app builds , however ionic 3 is still in beta
Tom McKearney
@tommck
Apr 22 2017 22:23
ah.. shows how much I know.. I thought ionic 2 was still in beta :)
(just started playing with it)
Tom McKearney
@tommck
Apr 22 2017 22:29
I might even upgrade to ionic3, since I'm just learning this stuff anyway
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:33
by the way there is not much difference between the two , code syntax is all same
Tom McKearney
@tommck
Apr 22 2017 22:33
cool
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:33
Tom McKearney
@tommck
Apr 22 2017 22:33
nice
angular4 too :)
Nelson Bwogora
@nelsonBlack
Apr 22 2017 22:35
:smile: a programmer who went to serve time in prison some five years ago might give up catching up once he is free , things moving fast out here
Tom McKearney
@tommck
Apr 22 2017 22:35
:)
Tom McKearney
@tommck
Apr 22 2017 22:47