Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

ng-monet

1.0.4 • Public • Published

ngMonet

Monet.js module for Angular 1.x

npm install ng-monet --save

Import ngMonet as an Angular service.

First add the script in your HTML file.

<body>
  <!-- Import angular first -->
  <script src='/node_modules/angular/angular.min.js'></script> 
  <!-- Import ng-ramda second -->
  <script src='/node_modules/ng-monet/ngMonet.min.js'></script> 
</body>

OR import via JavaScript

import 'ng-monet';
 
// or
 
require('ng-monet');

Then just inject the module and service.

 
angular.module('myApp', ['ngMonet'])
  .service('myService', function myService (ngMonet, $http) {
    var getPost = ngMonet.IO(postId => $http.get(`/API/posts/${postId}`));
    var updatePost = postId => ngMonet.IO(postBody => $http.post('/API/posts', { id: postId, body: postBody }));
    return {
      getPost,
      updatePost,
    };
  });

You can find the Monet.js docs here: https://cwmyers.github.io/monet.js/

install

npm i ng-monet

Downloadsweekly downloads

6

version

1.0.4

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability