ionic-team / tutorial-photo-gallery-angular Goto Github PK
View Code? Open in Web Editor NEWPhoto Gallery Tutorial: Ionic Angular and Capacitor
Home Page: https://ionicframework.com/docs/angular/your-first-app
License: Other
Photo Gallery Tutorial: Ionic Angular and Capacitor
Home Page: https://ionicframework.com/docs/angular/your-first-app
License: Other
Fail to npm install and got error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @ionic/[email protected]
npm ERR! Found: @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"^12.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular-devkit/build-angular@"^0.1102.4" from @ionic/[email protected]
npm ERR! node_modules/@ionic/angular-toolkit
npm ERR! dev @ionic/angular-toolkit@"^3.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! peer @angular-devkit/build-angular@"^0.1102.4" from @ionic/[email protected]
npm ERR! node_modules/@ionic/angular-toolkit
npm ERR! dev @ionic/angular-toolkit@"^3.1.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
ng.cmd run app:serve --host=localhost --port=8100 [ng] An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' [ng] Require stack: [ng] - C:\Users\hp\photo-gallery\node_modules@angular-devkit\architect\node\node-modules-architect-host.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular-devkit\architect\node\index.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\models\architect-command.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\commands\run-impl.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular-devkit\schematics\tools\export-ref.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular-devkit\schematics\tools\index.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\utilities\json-schema.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\models\command-runner.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\lib\cli\index.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\lib\init.js [ng] - C:\Users\hp\photo-gallery\node_modules@angular\cli\bin\ng [ng] See "C:\Users\hp\AppData\Local\Temp\ng-48spjQ\angular-errors.log" for further details. [ERROR] ng has unexpectedly closed (exit code 127). The Ionic CLI will exit. Please check any output above for error details.
You are using lazy loading for modules. So you have to configure and create the files apps/app-routing.module.ts
and
tabs-routing.module.ts
. I believe this documentation is missing in your tutorial, and the first page, "Taking Photos" is not working.
Hello!
I have a question about init app, in the article about capacitor 1.0 saw:
But in your code use:
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
SplashScreen.hide();
});
}
What is the reason? I understand if I use Cordova I must use platform.ready but with Capacitor, it's not necessary.
When running the command ionic start photo-gallery tabs --type=angular --capacitor
from the tutorial, the package.json
in the photo-gallery
folder has jasmine-core
at 3.4, which gives an npm warning because 3.5 is needed. Updating that number to 3.5 mitigates the warning.
Although great, an app in which I use the service is now broken, as it doesn't work with SDK30 as a result of a permissions issue. Would be great to see a fix!
How can we get File object from Camera / Photo gallery to upload it to Server using http request same as <input type="file"/>
I cloned this project and then run 'ionic serve'. But an error occurred while taking the photo.
TypeError: Cannot read property 'takePhoto' of undefined
at CameraPWA.capture (pwa-camera.entry.js:252)
at CameraPWA.handleShutterClick (pwa-camera.entry.js:316)
at HTMLDivElement.onClick (pwa-camera.entry.js:358)
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Object.onInvokeTask (core.js:41442)
at ZoneDelegate.invokeTask (zone-evergreen.js:398)
at Zone.runTask (zone-evergreen.js:167)
at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:480)
at invokeTask (zone-evergreen.js:1621)
at HTMLDivElement.globalZoneAwareCallback (zone-evergreen.js:1647)
Hi, many thanks for the tutorial.
is possible use select image file browser when camera not installed .?
Thanks.
Hi, many thanks for the tutorial. I am trying to implement this on mobile but both line 95 and 96 gives me this error of 'Property 'uri' does not exist on type 'FileWriteResult''.
Any idea why this happens? Thank you in advance/
v5.x, v6.x, v7.x
The my-first-app angular sample app unit tests fail.
ionic start ionic-my-first-app my-first-app --type=angular
cd ionic-my-first-app
npm run test
yields:
$ npm run test
> [email protected] test
> ng test
⠋ Generating browser application bundles (phase: setup)...Compiling @angular/core : es2015 as esm2015
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/platform-browser/testing : es2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @ionic/angular : es2015 as esm2015
⠙ Generating browser application bundles (phase: building)...10 10 2023 16:36:36.811:WARN [karma]: No captured browser, open http://localhost:9876/
10 10 2023 16:36:36.822:INFO [karma-server]: Karma v6.3.20 server started at http://localhost:9876/
10 10 2023 16:36:36.823:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
10 10 2023 16:36:36.825:INFO [launcher]: Starting browser Chrome
✔ Browser application bundle generation complete.
./src/app/app.component.spec.ts:5:0-63 - Error: Module not found: Error: Can't resolve '@ionic-native/splash-screen/ngx' in '/usr/local/YML/WWW/miles-by-motorcycle.com/ionic-my-first-app/src/app'
./src/app/app.component.spec.ts:6:0-57 - Error: Module not found: Error: Can't resolve '@ionic-native/status-bar/ngx' in '/usr/local/YML/WWW/miles-by-motorcycle.com/ionic-my-first-app/src/app'
Error: src/app/app.component.spec.ts:5:30 - error TS2307: Cannot find module '@ionic-native/splash-screen/ngx' or its corresponding type declarations.
5 import { SplashScreen } from '@ionic-native/splash-screen/ngx';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/app.component.spec.ts:6:27 - error TS2307: Cannot find module '@ionic-native/status-bar/ngx' or its corresponding type declarations.
6 import { StatusBar } from '@ionic-native/status-bar/ngx';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✔ Browser application bundle generation complete.
./src/app/app.component.spec.ts:5:0-63 - Error: Module not found: Error: Can't resolve '@ionic-native/splash-screen/ngx' in '/usr/local/YML/WWW/miles-by-motorcycle.com/ionic-my-first-app/src/app'
./src/app/app.component.spec.ts:6:0-57 - Error: Module not found: Error: Can't resolve '@ionic-native/status-bar/ngx' in '/usr/local/YML/WWW/miles-by-motorcycle.com/ionic-my-first-app/src/app'
Error: src/app/app.component.spec.ts:5:30 - error TS2307: Cannot find module '@ionic-native/splash-screen/ngx' or its corresponding type declarations.
5 import { SplashScreen } from '@ionic-native/splash-screen/ngx';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: src/app/app.component.spec.ts:6:27 - error TS2307: Cannot find module '@ionic-native/status-bar/ngx' or its corresponding type declarations.
6 import { StatusBar } from '@ionic-native/status-bar/ngx';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It should pass the unit tests.
$ ionic start ionic-my-first-app my-first-app --type=angular
$ cd ionic-my-first-app
$ npm run test
No response
Ionic:
Ionic CLI : 7.1.1 (/home/yml/.config/nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.9.4
@angular-devkit/build-angular : 12.2.18
@angular-devkit/schematics : 12.2.18
@angular/cli : 12.2.18
@ionic/angular-toolkit : 4.0.0
Capacitor:
Capacitor CLI : 4.4.0
@capacitor/android : 4.4.0
@capacitor/core : 4.4.0
@capacitor/ios : 4.4.0
Utility:
cordova-res : not installed globally
native-run (update available: 1.7.3) : 1.7.1
System:
NodeJS : v16.14.2 (/home/yml/.config/nvm/versions/node/v16.14.2/bin/node)
npm : 8.5.0
OS : Linux 5.3
The spec references ionic-native and not capacitor.
Hi, I've been following your tutorial for this app and I've managed to get it to run just fine on desktop Chrome using ionic serve
. I've also tried running them within web browsers on both android and iOS devices but the camera doesn't launch on mobile - nothing happens when you click on the camera button. Will it only work on mobile if deployed and run as mobile apps? Or am I missing something here?
Thanks!
On iOS, when saving a couple of photos, closing the app, restarting and adding another photo, some of the existing ones are being replaced by the new one.
Same problem exists in react version: ionic-team/tutorial-photo-gallery-react#8
No longer needed.
Also, consider renaming Photo's webviewPath to just "webPath".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.