Nipun Thathsara
Nipun Thathsara

Reputation: 1139

how to install (bower) an angular directive to a Meteor application?

I have a Meteor application with an Angular frontend. I want to check for any unsaved data in forms before navigation. Found this Angular directive angular-unsavedChanges but it requires to be added with Bower. How can i use this in Meteor? (Went through previous questions, and seperately downloaded and placed the directive in lib, still not woking) New bee to both Javascript and Angular, appreciate if you could be a little descriptive.

Upvotes: 0

Views: 64

Answers (1)

NFab
NFab

Reputation: 426

According to the basic usage instructions, you do not necessarily need to install this using Bower. You just need a hard copy of the files available in your project that can be referenced.

You should be able to set up this up with the following steps:

  1. In your Meteor project, navigate to or create a directory named public in the root directory of the project.
  2. Navigate to the public directory and create a new directory named bower_components.
  3. Copy the files from the Github repo to this directory.
    • If using the command line, run the command git clone [email protected]:facultymatt/angular-unsavedChanges.git.
    • If manually copying the files, create a new directory named angular-unsavedChanges, and save the files to this directory.
  4. Inside the <head></head> tags that will be rendered on the page you want to use the code on (in your component, index file, head file, etc), add <script src="/bower_components/angular-unsavedChanges/dist/unsavedChanges.js"></script>.

Upvotes: 1

Related Questions