I would like to consume the gmaps.js external library in an Angular 2 application. I'm usng Webpack for loading my modules.
Could anyone please help me how i could that?
Thank you in advance...
Well there is a library already built for that: angular2-google-maps
https://angular-maps.com/
I'm currently researching around this problem too because it seems not to be actually a complete out-of-the-box solution at this time since it lacks several features and has a couple of relevant issues, as you can see from the project github open issues page.
but it works indeed and could be the way to go if you're looking for easy to use components for a small side feature of your application.
It's not hard to use it with webpack:
-install the ng2 google maps via npm
npm install angular2-google-maps --save
-import the needed elements
/**
* ng2 Google maps
*/
import {
MapsAPILoader,
NoOpMapsAPILoader,
MouseEvent,
GOOGLE_MAPS_DIRECTIVES,
GOOGLE_MAPS_PROVIDERS
} from 'angular2-google-maps/core';
-and use them within your component: the getting started plunker should work with webpack as well if you take a look at app/main.ts ( I'm not going to post it here 'cause the code isn't mine )
http://plnkr.co/edit/YX7W20?p=preview
Related
Please forgive my ignorance, Any advice/directional assistance would be greatly appreciated.
I have a small app that reads data from an API with json requests.
One of the actions the app needs to do is to download a given PDF and open it either in the app, or in the OS default viewer.
I have followed several guides, but I think I am not including all needed files or something. The guides don't speak of including files of any type, but I still get errors.
In this link for example I followed the steps, but I am getting an error when I add these two lines in to the script at the bottom of the page:
var fileTransfer = new FileTransfer();
console.log(FileTransfer);
When running that I get the error Uncaught ReferenceError: FileTransfer is not defined at employee_documents.html:102
I am sure that either i am not including the files correctly in netbeans or I am missing something simple...
Any advise would be greatly appreciated.
To answer the question specifically. In order to solve the error, you need to run the cordova app using the CLI. In that way, the plugins installed from your cordova will be used otherwise if you're only running it via refresh or something similar it will produce an error like this.
In other words, type this command in your CLI:
cordova run browser
You can change this to your preferred platform (android, ios)
I'm pretty new to app development scene and I am starting my journey with nativescript. For my first app I'm trying to implement a googlemaps api in my app.
But when i try to run the demo that's included with the plugin or try to implement it into my app, I keep getting the same error (the pictures below).
I've got no clue what the cause of it is and can't find any solution to it.
Has anyone had the same problem or can anyone clarify what the source of the problem is?
A sincere thank you in advance
Problem
I keep getting the following errors.
source of plugin
"https://github.com/EddyVerbruggen/nativescript-directions"
Seems like you haven't done a full build since adding the plugin, only livesynced changes. Try readding the platform folders and do a "tns run ios/android".
I'm having problems running the polymer build command of the polymer CLI, it gives me the following feedback:
and neither of my built folders (bundled or unbundled) have the javascript files. The build process places <script> tag with the src of a javascript file in the place of my javascript code, but this files are not being generated.
I don't know if both errors are related, but I don't know what can I do to generate the <component>.html_script_0.js files.
I had this same problem and saw that there were several issues reporting it.
It seems a fix has been already merged and is part of v0.9.0 but I'm not completely sure if the fix is up on npm just yet.
I am using google web components from the following page but it seems that it has a lot of error. A lot of file is not found. Note: I am using google sign in and google analytics.
Google Web Components
How to resolve the issue without downloading and replace the the missing file path one by one?
You approach is completely wrong.
TL;DR One can not simply refer the url for the file and hope that relative paths in it are resolved automagically. The workflow is a way more complicated.
You should create an application (the easiest way is to use Yeoman’s generator for that). Than you should explicitly specify, which components you want to use with bower:
bower install google-calendar --save
... etc
That would install the components locally (--save is to update your bower.json).
Then you probably would vulcanize everything (thanks yeoman generator, grunt script comes with all the tasks prepared.) Your project is now ready to deploy.
Hope it helps.
You should be able to install the missing dependency components the same way you got your Google Web Component. Whether that is via download or bower or whatever, just make sure the relative paths line up. Even if you create a build task or generator you will still need the components dependencies correctly referenced.
I'm looking for a node.js module, which is able to generate PDF from HTML.
I know there are many options e.g. phantomjs, wkhtmltopdf. All this utilities require some command line tools.
I need something, that is easy to install (only npm install xxx) and is ready for use. I also don't want to call it by requests (REST API). Do anybody know something?
Thanks in advance.
You might want to give pdfkitjs or pdfmake a try. Both the projects are available as npm modules and are pretty well documented on github.