Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70440 articles
Browse latest View live

Android whitescreen Uncaught Error: Cannot find module "."

$
0
0

@thornbury wrote:

I’m getting this error when I try to emulate in Android Studio or build the app for running on a device. It’s not a very helpful message, so it’s causing me a massive problem trying to figure out what is causing it.

As soon as the this message appears, the app displays a whitescreen and freezes.

I’ve spent many days and tried many solutions trying to get this working, but still can’t find a way around it, so I’m hoping someone on here can help.

My project is on the latest ionic, cordova and plugin versions as at 2019/06/03 (I also tried rolling everything back to several previous versions to no avail).

ionic cordova build android, works with no errors, but when I do a run in Android Studio, Uncaught Error: Cannot find module “.”, appears in the logs.

I’ve compared the logs to a known good log of the same app and this is the only difference, so I have to conclude that whatever is causing the problem is also producing this message.

OS: MacOSX Mojave 10.14.5
Android Studio: 3.4.1
Gradle: 5.4.1
Android Gradle: 3.4.1
Build Tools: 28.0.3
Compile SDK: 28
Java: 1.8

Log messages before and after the error message:

D/LaunchNavigatorPlugin: Plugin action=discoverSupportedApps
I/ShortcutBadger: Checking if platform supports badge counters, attempt 1/3.
I/ShortcutBadger: Badge counter is supported in this platform.
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false
D/SystemWebChromeClient: http://localhost/build/vendor.js: Line 31978 : Uncaught Error: Cannot find module "."
I/chromium: [INFO:CONSOLE(31978)] "Uncaught Error: Cannot find module "."", source: http://localhost/build/vendor.js (31978)
D/SystemWebChromeClient: http://localhost/build/vendor.js: Line 143289 : Ionic Native: deviceready event fired after 46 ms
I/chromium: [INFO:CONSOLE(143289)] "Ionic Native: deviceready event fired after 46 ms", source: http://localhost/build/vendor.js (143289)
D/CordovaWebViewImpl: onPageFinished(http://localhost/)
D/SERVER: Handling local request: http://localhost/assets/icon/favicon.ico
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false

Can anyone suggest what could be causing this error?

Posts: 1

Participants: 1

Read full topic


How to close keyboard in themeableBrowser

$
0
0

@rodrigo-rodero wrote:

Hi! how can I close the keyboard after insert data in a form at a external themeableBrowser? If I don’t know any event to do keyboard.hide()

Posts: 1

Participants: 1

Read full topic

Make app fully transparent

$
0
0

@bengostar wrote:

Hi,

Is it possible to make an app fully transparent, by overriding css vars? For example, I would like to make an application that shows a red ball which moves around the screen via device motion or touch events. But I only want the ball to be visible so that maybe the homescreen is visible in the background, so it looks like the ball is trapped inside the phone.

Posts: 2

Participants: 2

Read full topic

How to set an variable in variables.scss with class

$
0
0

@RaulGM wrote:

Hi, I have two kinds of ion-items. header and item. I need to set a different background according to the class it has.

I’ve tried already to set in global.scss, separately.

ion-item .header {
  --ion-item-background: var(--ion-color-primary); // if I set this line of code in variables.scss works, but I can't make the difference between classes.
  background-color: black; // this line doesn't even work.
}

If I get rid of the class in global.scss it works, but I need it with the class, obviously.

Thanks for the time!

Posts: 1

Participants: 1

Read full topic

Possible bug in Ionic 4 in Angular Reactive Forms:

$
0
0

@brettbutcher wrote:

This is part of an evaluation of Ionic for me and to be honest it just feels a bit flaky. I have ‘fixed’ my issue, but don’t understand why what I did first time around doesn’t work… Maybe this is some form of noobie error but I don’t think so. I think the function names are pretty obvious but that isn’t the issue anyway.

I initialize a user details form like this:

 ngOnInit() {
        this.userDetailsForm = this.formBuilder.group({

         ... some stuff

          _Address: [],     // This is a holding string value for the pop over form.

          ... more stuff
        });
        this.userService.getUserServer().subscribe (user => {
          this.userDetailsForm.patchValue(user);   // Note the _Address doesn't exist in the user obj.
          this.userService.saveUserStore(user);
          this.userdata = user;
          this.address = new Address(this.userdata.Address); // preserve original address data
          this.userDetailsForm.value._Address = this.address.fullAddressString();

        },
          error => this.helper.showAlert('We cant connect to the server at the moment msg is:' + error)
        );

The _Address value is to represent the address as a single string which is completed in a separate Ionic-popover (which all works just fine).
However in the form, with the Address string value like this:

  <ion-item>
      <ion-label position="fixed">Address:</ion-label>
      <ion-input type="text" (click)="getAddress($event)" formControlName="_Address">{{ userDetailsForm.value._Address }}</ion-input>      
    </ion-item>

It doesn’t work in the initialization part. It DOES work when I update it from the popover code.
If however, I change it to this:

    <ion-item>
      <ion-label position="fixed">Address:</ion-label>
      <ion-input type="text" (click)="getAddress($event)" formControlName="_Address">{{ addressString }}</ion-input>      
    </ion-item>

… and set the ‘addressString’ value in the ngOnInit function like this instead:

          // originally - this.userDetailsForm.value._Address = this.address.fullAddressString();
          this.addressString = this.address.fullAddressString();

It initializes and displays just fine.
If I log the value of the form _Address, it is also just fine. Just not displayed on initialization.
Many thanks.

Posts: 1

Participants: 1

Read full topic

IONIC 4 - Show Route page from a modal

$
0
0

@NurGuz wrote:

Hi all.

I have a modal window, from which I make a routing change.

 this.router.navigate(['/app/tabs/maps'], {
            state: {
                uid: this.uid,
                autocomplete: true
            }
        });

That route change is made, but behind the modal window. I want it to occur in front of the modal window.

Any ideas?

Thank you

Posts: 1

Participants: 1

Read full topic

Button ion-fab with ngFor

$
0
0

@danielcombain wrote:

Heya!

I have a question about some, maybe css issues?
I have a fab-list with fab buttons. I’m creating the buttons with ngFor since I want to keep it in an object with possibility to enable/disable them.

it looks like this:

  <!-- FAB LIST -->
  <ion-fab bottom right (click)='dim.toggle()'>
    <button ion-fab><ion-icon name='add'></ion-icon></button>
    <ion-fab-list side='top'>
      <button *ngFor='let item of fabs' ion-fab (click)='fabAction($event, item.action)'>
        <div *ngIf='item.display'>
          <ion-icon name="{{item.icon}}"></ion-icon>
          <ion-label>{{item.label}}</ion-label>
        </div>
      </button>
    </ion-fab-list>
  </ion-fab>

The problem is that when doing it in an ngFor loop the icon gets displaced.
When writing it directly in the HTML like this there is no issue:

<button ion-fab>
    <ion-icon name="add-circle"></ion-icon>
    <ion-label>Label</ion-label>
</button>

So, question is, am I doing something wrong or is it just compiling wrong? Can I add classes to it separately, do some workaround?

Imgur

Posts: 1

Participants: 1

Read full topic

Cannot find type definition file for '@types

$
0
0

@zakzbir wrote:

so i’m building an ionic application for android and ios devices.

when i’m trying to build application in android with command ‘ionic cordova build android --prod --release’, it works fine in (on windows)

butt in ios with the same command (on mac), gives me this error:

10:35:55]  typescript error 
        Cannot find type definition file for '@types'. 

[10:35:55]  ionic-app-script task: "build" 
[10:35:55]  Error: Failed to transpile TypeScript 
Error: Failed to transpile TypeScript
at errorCheckProgram (/Users/zakaria/Desktop/untitled 
folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- 
compiler.js:119:39)
at Object.<anonymous> (/Users/zakaria/Desktop/untitled 
folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- 
compiler.js:89:21)
at step (/Users/zakaria/Desktop/untitled 
folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- 
compiler.js:32:23)
at Object.next (/Users/zakaria/Desktop/untitled 
folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- 
compiler.js:13:53)
at fulfilled (/Users/zakaria/Desktop/untitled 
folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- 
compiler.js:4:58)
[ERROR] An error occurred while running subprocess ionic-app- 
scripts.

    ionic-app-scripts build --prod --target cordova --platform ios 
 exited with exit code 1.

    Re-running this command with the --verbose flag may provide 
more information.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! transatour@0.0.1 build:prod:ios: `cross-env 
NODE_OPTIONS='- 
-max-old-space-size=8192' ionic cordova build ios --prod --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the transatour@0.0.1 build:prod:ios script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zakaria/.npm/_logs/2019-06-03T11_35_55_786Z- 
 debug.log

Posts: 1

Participants: 1

Read full topic


Je suis étudiant en développement d'application

$
0
0

@akoffi wrote:

lorsque j’exécute la commande ionic cordova emulate ça ne passe pas.voici ce qu’on met dit:[ERROR] native-run was not found on your PATH. Please install it globally:

    npm i -g native-run

aidez moi

Posts: 1

Participants: 1

Read full topic

Ionic slides : different behavior

$
0
0

@Hexago wrote:

Hello there!

I am trying to create an app with many slides pages. For that I am using the https://ionicframework.com/docs/api/slides with the ion-slides.

So far, everything is working.
The problem is that I would like to give a different behavior to the first slide.
By using the http://idangero.us/swiper/api/ plugin’s parameters, I would like to change the slide gestures.

However, how can assign 2 behaviors to 1 ion-slides?

Thank you so much!

Posts: 1

Participants: 1

Read full topic

Can you subscribe to InAppBrowser Events from browser?

$
0
0

@Dunny wrote:

So, I’m trying to use the InAppBrowser in a browser but I keep getting an undefined message for subscribing to events.

I’m wondering if this is only available on an Anroid/iOS device?

const browser: InAppBrowserObject = this.theInAppBrowser.create(this.Url, “_blank”, options);

browser.on(‘beforeload’).subscribe(event =>
{
console.log(“beforeload -->”,event);
});

Posts: 1

Participants: 1

Read full topic

New to Ionic Studio

$
0
0

@aarcex wrote:

Hello

First please excuse me if the following questions are too “basic”, that´s beacuse I´m really new to Ionic Framework.
I need to develop the frontend on an application. I would like to create a PWA so that it can run on the web and mobiles.
Besides the UI, I need to communicate with external databases using REST calls with JSON format
So here are my questions:

  1. Since I have so many projects at hand, I would like to have the most rapid development tools. I´m considering even Ionic Studio for visual develoment. Will it be a good fit for my requirements?
  2. Does Studio supports REACT and VUE?
  3. Do I really need REACT/VUE to develop my app (with my requirements above)?
  4. Does Studio support REST calls to access remote databases?

Posts: 1

Participants: 1

Read full topic

Error at ionic start myApp tabs

$
0
0

@NickLockett wrote:

new to ionic

Everything ran well until trying ionic start myApp tabs when multiple errors arose
need hep please

Last login: Mon Jun 3 18:34:01 on ttys001
NL-17-MacBook-Pro:~ netlaw$ sudo ionic start myApp tabs
Password:
? ./myApp exists. Overwrite? Yes
:heavy_check_mark: Preparing directory ./myApp - done!
:heavy_check_mark: Downloading and extracting tabs starter - done!

Installing dependencies may take several minutes.

──────────────────────────────────────────────────────────────────────

  Ionic Enterprise, platform and solutions for teams by Ionic

              Powerful library of native APIs ⚡️
             A supercharged platform for teams 💪
   Bring your company's designs to life with Design Systems 🎨

              👉  https://ion.link/enterprise  👈

──────────────────────────────────────────────────────────────────────

npm i

fsevents@1.2.9 install /Users/netlaw/myApp/node_modules/fsevents
node install

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@10.16.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir ‘/Users/netlaw/myApp/node_modules/fsevents/lib’
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/netlaw/myApp/node_modules/fsevents/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “configure” “–fallback-to-build” “–module=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node” “–module_name=fse” “–module_path=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64” “–napi_version=4” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v64”
gyp ERR! cwd /Users/netlaw/myApp/node_modules/fsevents
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/netlaw/myApp/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command “/usr/local/bin/node” “/Users/netlaw/myApp/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /Users/netlaw/myApp/node_modules/fsevents
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/netlaw/myApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64’ (1)

node-sass@4.12.0 install /Users/netlaw/myApp/node_modules/node-sass
node scripts/install.js

Unable to save binary /Users/netlaw/myApp/node_modules/node-sass/vendor/darwin-x64-64 : { Error: EACCES: permission denied, mkdir ‘/Users/netlaw/myApp/node_modules/node-sass/vendor’
at Object.mkdirSync (fs.js:757:3)
at sync (/Users/netlaw/myApp/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/netlaw/myApp/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/netlaw/myApp/node_modules/node-sass/scripts/install.js:114:11)
at Object. (/Users/netlaw/myApp/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path: ‘/Users/netlaw/myApp/node_modules/node-sass/vendor’ }

core-js@2.6.9 postinstall /Users/netlaw/myApp/node_modules/core-js
node scripts/postinstall || echo “ignore”

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js
https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

node-sass@4.12.0 postinstall /Users/netlaw/myApp/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /Users/netlaw/myApp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ ‘/usr/local/bin/node’,
gyp verb cli ‘/Users/netlaw/myApp/node_modules/node-gyp/bin/node-gyp.js’,
gyp verb cli ‘rebuild’,
gyp verb cli ‘–verbose’,
gyp verb cli ‘–libsass_ext=’,
gyp verb cli ‘–libsass_cflags=’,
gyp verb cli ‘–libsass_ldflags=’,
gyp verb cli ‘–libsass_library=’ ]
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | darwin | x64
gyp verb command rebuild
gyp verb command clean
gyp verb clean removing “build” directory
gyp verb command configure
gyp verb check python checking for Python executable “python2” in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/netlaw/myApp/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/netlaw/myApp/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/netlaw/myApp/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/netlaw/myApp/node_modules/which/which.js:89:16
gyp verb which failed at /Users/netlaw/myApp/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/netlaw/myApp/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/netlaw/myApp/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/netlaw/myApp/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/netlaw/myApp/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/netlaw/myApp/node_modules/which/which.js:89:16
gyp verb which failed at /Users/netlaw/myApp/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/netlaw/myApp/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb which failed stack:
gyp verb which failed ‘Error: not found: python2\n at getNotFoundError (/Users/netlaw/myApp/node_modules/which/which.js:13:12)\n at F (/Users/netlaw/myApp/node_modules/which/which.js:68:19)\n at E (/Users/netlaw/myApp/node_modules/which/which.js:80:29)\n at /Users/netlaw/myApp/node_modules/which/which.js:89:16\n at /Users/netlaw/myApp/node_modules/isexe/index.js:42:5\n at /Users/netlaw/myApp/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:153:21)’,
gyp verb which failed code: ‘ENOENT’ }
gyp verb check python checking for Python executable “python” in the PATH
gyp verb which succeeded python /usr/bin/python
gyp verb check python version /usr/bin/python -c "import sys; print "2.7.10 gyp verb check python version .%s.%s" % sys.version_info[:3];" returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.16.0
gyp verb command install [ ‘10.16.0’ ]
gyp verb install input version string “10.16.0”
gyp verb install installing version: 10.16.0
gyp verb install --ensure was passed, so won’t reinstall if already installed
gyp verb install version is already installed, need to check “installVersion”
gyp verb got “installVersion” 9
gyp verb needs “installVersion” 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.16.0
gyp verb build dir attempting to create “build” dir: /Users/netlaw/myApp/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/Users/netlaw/myApp/node_modules/node-sass/build’
gyp ERR! System Darwin 17.7.0
gyp ERR! command “/usr/local/bin/node” “/Users/netlaw/myApp/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=”
gyp ERR! cwd /Users/netlaw/myApp/node_modules/node-sass
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 postinstall: node scripts/build.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 1052 packages from 1037 contributors and audited 53276 packages in 44.537s
found 0 vulnerabilities

git init
Initialized empty Git repository in /Users/netlaw/myApp/.git/
git add -A
git commit -m “Initial commit” --no-gpg-sign
[master (root-commit) d22f13d] Initial commit
Committer: System Administrator root@nl-17-macbook-pro.home
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

git config --global --edit

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

53 files changed, 11975 insertions(+)
create mode 100644 .gitignore
create mode 100644 angular.json
create mode 100644 e2e/protractor.conf.js
create mode 100644 e2e/src/app.e2e-spec.ts
create mode 100644 e2e/src/app.po.ts
create mode 100644 e2e/tsconfig.e2e.json
create mode 100644 ionic.config.json
create mode 100644 package-lock.json
create mode 100644 package.json
create mode 100644 src/app/app-routing.module.ts
create mode 100644 src/app/app.component.html
create mode 100644 src/app/app.component.spec.ts
create mode 100644 src/app/app.component.ts
create mode 100644 src/app/app.module.ts
create mode 100644 src/app/app.scss
create mode 100644 src/app/tab1/tab1.module.ts
create mode 100644 src/app/tab1/tab1.page.html
create mode 100644 src/app/tab1/tab1.page.scss
create mode 100644 src/app/tab1/tab1.page.spec.ts
create mode 100644 src/app/tab1/tab1.page.ts
create mode 100644 src/app/tab2/tab2.module.ts
create mode 100644 src/app/tab2/tab2.page.html
create mode 100644 src/app/tab2/tab2.page.scss
create mode 100644 src/app/tab2/tab2.page.spec.ts
create mode 100644 src/app/tab2/tab2.page.ts
create mode 100644 src/app/tab3/tab3.module.ts
create mode 100644 src/app/tab3/tab3.page.html
create mode 100644 src/app/tab3/tab3.page.scss
create mode 100644 src/app/tab3/tab3.page.spec.ts
create mode 100644 src/app/tab3/tab3.page.ts
create mode 100644 src/app/tabs/tabs.module.ts
create mode 100644 src/app/tabs/tabs.page.html
create mode 100644 src/app/tabs/tabs.page.scss
create mode 100644 src/app/tabs/tabs.page.spec.ts
create mode 100644 src/app/tabs/tabs.page.ts
create mode 100644 src/app/tabs/tabs.router.module.ts
create mode 100644 src/assets/icon/favicon.png
create mode 100644 src/assets/shapes.svg
create mode 100644 src/environments/environment.prod.ts
create mode 100644 src/environments/environment.ts
create mode 100644 src/global.scss
create mode 100644 src/index.html
create mode 100644 src/karma.conf.js
create mode 100644 src/main.ts
create mode 100644 src/polyfills.ts
create mode 100644 src/test.ts
create mode 100644 src/theme/variables.scss
create mode 100644 src/tsconfig.app.json
create mode 100644 src/tsconfig.spec.json
create mode 100644 src/tslint.json
create mode 100644 src/zone-flags.ts
create mode 100644 tsconfig.json
create mode 100644 tslint.json

[INFO] Next Steps:

   - Go to your newly created project: cd ./myApp
   - Run ionic serve within the app directory to see your app
   - Build features and components: https://ion.link/scaffolding-docs
   - Get Ionic DevApp for easy device testing: https://ion.link/devapp

NL-17-MacBook-Pro:~ netlaw$

Posts: 1

Participants: 1

Read full topic

Ionic 4 - ion-list adding filter to async

$
0
0

@JohnCressman wrote:

Is is possible to add filter to an ion-list that is using async?

I see example of using filter, but never with async. when i try, I get an error saying Unresolved Pipe filter

  <ion-searchbar placeholder="Search by Name" (ngModel)="searchTerm"></ion-searchbar>
  <ion-list *ngIf="results">
    <ion-item button *ngFor="let item of (results | async | filter:searchTerm)" routerDirection="forward" [routerLink]="['/hospital-details/'+ item.id]">
      <ion-label text-wrap>
        <h3>{{ item.name }}</h3>
      </ion-label>
    </ion-item>
  </ion-list>

But I see examples that are working:

   <ion-list>
      <ion-item  type="item-text-wrap" href="#/tab/friend/{{friend.id}}"
        ng-repeat="friend in friends | filter:search | limitTo:listlength">
        {{friend.name}}
      </ion-item>
    </ion-list>

Posts: 1

Participants: 1

Read full topic

Continue with android studio

$
0
0

@robertnic wrote:

I’m not sure how it might sound to you, but I’m at certain point of my development that where Cordova plugins are helpless to me and i can use some java coding to get what i need, so my question here is:

Is it possible for me to use android studio to continue my development and code with java?

Posts: 1

Participants: 1

Read full topic


Cordova not working

$
0
0

@androidelp wrote:

my Ionic 4.12
my npm 6.9.0
my nodejs v10.16.0
Ubuntu 19.04

Cordova is installed in npm in version 9.0.0

$ npm info cordova

cordova@9.0.0 | Apache-2.0 | deps: 8 | versions: 942

had a problem with the ‘ionic start demo tabs’ command as it did not install on the node-sass module.

So I performed ‘sudo npm install --unsafe-perm=true --allow-root’ its working my installl

My error is in install firebase:
sudo ionic cordova plugin add cordova-plugin-firebase

Error:
[ERROR] The Cordova CLI was not found on your PATH. Please install Cordova globally:

    npm i -g cordova

I not understand because the cordova cli not installed if by defaout npm 6.9.0 contain cordova?

Posts: 1

Participants: 1

Read full topic

Issues with my app after last deploy

Help in Ionic 4 and Firebase get the Subcolection

$
0
0

@Wayter wrote:

How to make a get function from a category (or firebase collection) where if I click on it browse to a page with the products of this categories (sub collection)

Posts: 1

Participants: 1

Read full topic

Ionic 3: async pipe within ion-select returns null until select

$
0
0

@kfrager wrote:

I have a custom pipe component which needs the async pipe along with it to return the output. It works across the app with no problems.

However, when using the custom component along with async pipe within an ion-select, on initial load it shows null [1] on the selected option, until you open the ion-select and then it populates all the correct outputs [2].

![when opening the modal the data shows as null][1]

![clicking ion-select open converts data appropriately][2]

I have taken off the pipes to see if the initial information is loading within the ion-select to begin with, and yes, the data is there. This only returns null when the pipes are implemented as well.

I am passing the ‘item’ object through navParams to this modal.

I have to use the async pipe along with this modal as the custom pipe waits to get data returned as a promise first, before it can transform it.

item-detail.html

<div *ngIf="item.variantGroup.variants.length > 1" class="w-100">
 <p padding-left><b>{{ item.variantGroup.name }}</b></p>
 <ion-select [(ngModel)]="item.selected.variant" [selectOptions]="{title: 'Choose an option'}" required class="w-100">
  <ion-option *ngFor="let v of item.variantGroup.variants" [value]="v">{{ v.name + ' (' + ( v.price | enhancedCurrency | async ) + ')' }} 
  </ion-option>
 </ion-select>
</div>

enhanced-currency.ts (pipe)

transform(value: any, symbol: string) {
 let countryCurrency: string;

 return this.userProvider.getCountry().then((data: string) => {
   !symbol ? countryCurrency = UtilitiesProvider.getMetadataOfCountry(data).currency : countryCurrency = symbol;

  return this.cp.transform(_.round(value / 100, 2), countryCurrency, 'symbol-narrow'); 
});

The expected output should show the price transformed straight away on modal open.

So in the above example of the pictures it would be showing $3.50 and not null.

Posts: 1

Participants: 1

Read full topic

Sometimes Photo path and name are not found on photo upload page

$
0
0

@ymphyow wrote:

Hello I am using the ionic cordova camera, file and filepath plugin . I am facing this error while selecting and deleting pictures.
When I test it on on separate project, it works. I still can’t find out the problem. could you please guide me?

Error:

ERROR TypeError: Cannot read property 'path' of null
    at Object.eval [as updateDirectives] (UploadPhotosPage.html:15)
    at Object.debugUpdateDirectives [as updateDirectives] (vendor.js:59830)
    at checkAndUpdateView (vendor.js:59226)
    at callViewAction (vendor.js:59467)
    at execEmbeddedViewsAction (vendor.js:59430)
    at checkAndUpdateView (vendor.js:59227)
    at callViewAction (vendor.js:59467)
    at execComponentViewsAction (vendor.js:59409)
    at checkAndUpdateView (vendor.js:59232)
    at callViewAction (vendor.js:59467)
polyfills.js:3040 Unhandled Promise rejection: Cannot read property 'destroyed' of null ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'destroyed' of null
    at ViewContainerRef_.push../node_modules/@angular/core/fesm5/core.js.ViewContainerRef_.move (vendor.js:57553)
    at vendor.js:3313
    at DefaultIterableDiffer.push../node_modules/@angular/core/fesm5/core.js.DefaultIterableDiffer.forEachOperation (vendor.js:55020)

Here is photo_upload.html

<ion-header>
  <ion-toolbar>
    <ion-title color="primary">Upload Photos</ion-title>
    <ion-buttons slot="end">
      <ion-button clear (click)="uploadImageData()">Done</ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content padding>
  <h3 *ngIf="images.length == 0" text-center>Please Select Image!</h3>
  <ion-list>
    <ion-item *ngFor="let img of images; index as pos" text-wrap>
      <ion-thumbnail slot="start">
        <ion-img [src]="img.path"></ion-img>
      </ion-thumbnail>
      <ion-label>
        {{ img.name }}
      </ion-label>
      <ion-button slot="end" fill="clear" (click)="deleteImage(img, pos)">
          <ion-icon slot="icon-only" name="trash"></ion-icon>
        </ion-button>
    </ion-item>
  </ion-list>
</ion-content>
<ion-footer>
  <ion-toolbar color="primary">
    <ion-button fill="clear" expand="full" color="light" (click)="selectImage()">
      <ion-icon slot="start" name="camera"></ion-icon>
      Select Image
    </ion-button>
  </ion-toolbar>
</ion-footer>

Here is my photo_uoload.ts file

import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
import { Platform, ActionSheetController, ToastController, LoadingController, AlertController } from '@ionic/angular';
import { Camera, CameraOptions } from '@ionic-native/Camera/ngx';
import { File, FileEntry } from '@ionic-native/File/ngx';
import { Storage } from '@ionic/storage';
import { Router } from '@angular/router';
import { WebView } from '@ionic-native/ionic-webview/ngx';
import { OraclemcsService } from './../../services/oraclemcs.service';
import { presentAlert,UiutilsService } from "../../utils/ui-utility.service";

const STORAGE_KEY = 'care_report_images';

@Component({
  selector: 'app-upload-photos',
  templateUrl: './upload-photos.page.html',
  styleUrls: ['./upload-photos.page.scss'],
})
export class UploadPhotosPage implements OnInit {

  constructor(private platform: Platform
    , public actionSheetController: ActionSheetController
    , private camera: Camera
    , private toastController: ToastController
    , private file: File
    , private storage: Storage
    , public router: Router
    , private webview: WebView
    , private loadingController: LoadingController
    , private ref: ChangeDetectorRef
    , private alertController: AlertController
    , private mcsService: OraclemcsService
    ) { }

   public images = [];
  lastImage: string = null;
  ngOnInit() {
  }

  ionViewDidEnter() {
    document.addEventListener("backbutton", function (e) {
      console.log("disable back button")
    }, false);
  }

  /** 
   * action selection list
  */
 async selectImage() {
  if (this.images.length < 3) {
    const actionSheet = await this.actionSheetController.create({
      header: "Select Image source",
      buttons: [{
        text: 'Load from Library',
        handler: () => {
          this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY);
        }
      },
      {
        text: 'Use Camera',
        handler: () => {
          this.takePicture(this.camera.PictureSourceType.CAMERA);
        }
      },
      {
        text: 'Cancel',
        role: 'cancel'
      }
      ]
    });
    await actionSheet.present();
  }else{  presentAlert("Images limit Exceeded",this.alertController); }
}

/**
 * copy picture to file system and update registry
 * @param sourceType 
 */
public takePicture(sourceType) {
  var options: CameraOptions = {
    quality: 100,
    sourceType: sourceType,
    saveToPhotoAlbum: false,
    correctOrientation: true
  };

  this.camera.getPicture(options).then(imagePath => {
      var currentName = imagePath.substr(imagePath.lastIndexOf('/') + 1);
      if (currentName.lastIndexOf('?') > 0)
        currentName = currentName.substr(0, currentName.lastIndexOf('?'));
      var correctPath = imagePath.substr(0, imagePath.lastIndexOf('/') + 1);
      this.copyFileToLocalDir(correctPath, currentName, this.createFileName());
    });
}

/** 
 * copy to local directory
*/
copyFileToLocalDir(namePath, currentName, newFileName) {
  this.file.copyFile(namePath, currentName, this.file.dataDirectory, newFileName).then(success => {
    console.log('in copy file promise');
    this.updateStoredImages(newFileName);
    console.log(namePath+"1:"+currentName+"2:"+this.file.dataDirectory+"3:"+newFileName);
  }, error => {
    this.presentToast('Error while storing file.');
  });
}

/**
 * update registry
 * @param name 
 */
updateStoredImages(name) {
  this.storage.get(STORAGE_KEY).then(images => {
    let arr = JSON.parse(images);
    if (!arr) {
      let newImages = [name];
      this.storage.set(STORAGE_KEY, JSON.stringify(newImages));
    } else {
      arr.push(name);
      this.storage.set(STORAGE_KEY, JSON.stringify(arr));
    }

    let filePath = this.file.dataDirectory + name;
    let resPath = this.pathForImage(filePath);

    let newEntry = {
      name: name,
      path: resPath,
      filePath: filePath
    };

    this.images = [newEntry, ...this.images];
    console.log(JSON.stringify(this.images));
    this.ref.detectChanges(); // trigger change detection cycle
  });
}

/**
 * alert
 * @param text 
 */
async presentToast(text) {
  const toast = await this.toastController.create({
    message: text,
    position: 'bottom',
    duration: 3000
  });
  toast.present();
}

/**
 * mapped to a url file path
 * @param img 
 */
pathForImage(img) {
  if (img === null) {
    return '';
  } else {
    let converted = this.webview.convertFileSrc(img);
    return converted;
  }
}

/**
* create file name 
*/
createFileName() {
  var d = new Date(),
    n = d.getTime(),
    newFileName = n + ".jpg";
  return newFileName;
}

/**
 * ui remove image 
 * @param imgEntry 
 * @param position 
 */
deleteImage(imgEntry, position) {
  this.images.splice(position, 1);

  this.storage.get(STORAGE_KEY).then(images => {
    console.log("Delect Img_"+JSON.parse(images));
    let arr=JSON.parse(images);
    let filtered = arr.filter(name => name != imgEntry.name);
    this.storage.set(STORAGE_KEY, JSON.stringify(filtered));

    var correctPath = imgEntry.filePath.substr(0, imgEntry.filePath.lastIndexOf('/') + 1);
    console.log("Correct Path_"+correctPath +imgEntry.name);
    this.file.removeFile(correctPath, imgEntry.name).then(res => {
      this.presentToast('File removed.');
      this.ref.detectChanges();
    });
  });
}

async presentAlert(err) {
  const alert = await this.alertController.create({
    header: 'Alert',
    message: err,
    buttons: ['OK']
  });

  await alert.present();
}


}

Here is app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

import { IonicStorageModule } from '@ionic/storage';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { Camera } from '@ionic-native/Camera/ngx';
import { File } from '@ionic-native/File/ngx';
import { WebView } from '@ionic-native/ionic-webview/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
import { FileTransfer } from '@ionic-native/file-transfer/ngx';
import { HTTP } from '@ionic-native/http/ngx';

import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { Network } from '@ionic-native/network/ngx';

import { Toast } from "@ionic-native/toast/ngx";

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, "./assets/i18n/", ".json");
}

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule, 
    HttpClientModule,
    IonicModule.forRoot(), 
    AppRoutingModule, 
    IonicStorageModule.forRoot(),
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    StatusBar,
    SplashScreen,
    Camera,
    File,
    WebView,
    FilePath,
    FileTransfer,
    HTTP, 
    Network, Toast,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Posts: 1

Participants: 1

Read full topic

Viewing all 70440 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>