Comments (9)
I don't see any minified JS in the package. I'm afraid you would have to minify it yourself for now.
from awesome-cordova-plugins.
Yes, I try to self-help using gulp.
var typescript = require('gulp-tsc');
var concatJs = require('gulp-concat');
var uglifyJs = require('gulp-uglify');
var rename = require('gulp-rename');
var paths = {
typescript: ['src/**/*.ts'],
};
gulp.task('compile', function(done) {
gulp.src(paths.typescript)
.pipe(typescript({ emitError: false }))
.pipe(concatJs('ionic-native.js'))
.pipe(gulp.dest('dist'))
.pipe(uglifyJs())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('dist'))
.on('end', done);
});
Perhaps there is a sequence requirement when concatenating the ts file.
I hit errors like require is not defined
, so I try to add require.js
Then i hit Module name "ng1" has not been loaded yet for context: _. Use require([])
Anyone can share how you concat and minify ionic-native to a single js file?
from awesome-cordova-plugins.
@deepslux are you using Ionic 2?
If so, you do not need to import any JS files to your index.html. You also wouldn't need to minify anything.
Importing the plugin you need in your TypeScript files (import {Camera} from 'ionic-native';
) will result in the needed code to be compiled in your app bundle JS file.
from awesome-cordova-plugins.
@ihadeed I'm using Ionic 1. Is this repo meant for Ionic 2? Or anything I need to do to use it in Ionic 1?
from awesome-cordova-plugins.
@deepslux I haven't tested it personally. But looking at the code it looks like the Angular 1 usage would be by importing the ngCordova
module in your main app module. Then calling methods like ngCordova.Camera.getPicture().then(....
The methods are also exposed in the variable window.IonicNative.
I wrote a little article explaining the various way of using Ionic Native, but again I haven't really tested it. Hence, why I haven't officially published the article. But you can have a look here: http://jsdev.ca/ionic-native-cordova-plugins-simplified/
from awesome-cordova-plugins.
@deepslux did you manage to get ionic-native working with Ionic 1? I'm having issues setting things update. I've installed ionic-native, but now need to include ionic.native.js in my index.html, but having issues with the path.
from awesome-cordova-plugins.
@ihadeed Could you please assist, how should ionic-native be included in index.html. I'm having issues with referencing the correct path to ionic.native.js. I'm using Ionic 1.
from awesome-cordova-plugins.
This issue shouldn't be closed! It is not clear how to import the library when working with AngularJS 1.x
ngCordova (last reply) is not a valid answer as it doesn't exist anymore.
The import
keyword in the JS files is not supported and there's no native import. We need to know which files to include in the index.html and the order they should be added.
Thank you.
from awesome-cordova-plugins.
Please open a new issue with any questions that you have.
Currently there is no ES5 files exported in the Ionic Native package. It is still compatible with AngularJS 1.x but you need something to transform it from ES2015 to ES5 (Babel, Webpack, Rollup...etc).
ngCordova
doesn't exist anymore, we export it under the ionic.native
module. See https://unpkg.com/@ionic-native/[email protected]/ng1.js
from awesome-cordova-plugins.
Related Issues (20)
- Where to find real documentations? HOT 1
- Plugin bluetooth-le>RespondParams Interface> Missing optional property: address HOT 1
- download PDF file from external website with inappbrowser HOT 1
- Avoid `any` type and use tsdoc comment properly. HOT 1
- [BLE] Missing method `requestConnectionPriority`. HOT 1
- Creating Cordova Plugin HOT 1
- Add interface to diagnostic plugin HOT 1
- @awesome-cordova-plugins/local-notifications: getAllScheduled and getAllTriggered not working in Cordova HOT 1
- Is there any Unity3D plugin? HOT 1
- Plugin for Google Nearby Connections HOT 1
- social-sharing :: not working on onePlus device when share mp4 video. HOT 1
- Exception calling Diagnostic.requestBluetoothAuthorization method HOT 1
- Cannot find plugin.xml
- requestConnectionPriority() is missing in BLE plugin HOT 1
- @awesome-cordova-plugins/media seems not to work at all HOT 1
- @ionic-native/in-app-purchase-2 isnt compatible with billingclient v5 as required by Google to update apps HOT 1
- Where is @ionic-native/sqlite in awesome-cordova-plugins? HOT 1
- Can you add cordova-plugin-autostart please
- in-app-browser: actually support browser platform
- in-app-browser: error WEBPACK_IMPORTED_MODULE_2__.InAppBrowser.create is not a function HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-cordova-plugins.