ng-jsyaml

0.0.3 • Public • Published

ng-jsyaml

AngularJS wrapper for js-yaml package

This is just a package which allows using js-yaml in the AngularJS way.

Installation

NPM

npm install --save ng-jsyaml

Yarn

yarn add ng-jsyaml

Bower

bower install --save ng-jsyaml

Usage

  1. Add js-yaml and ng-jsyaml js files into your html file
...
<script src="path/to/js-yaml/dist/js-yaml.js"></script>
<script src="path/to/ng-jsyaml/angular-jsyaml.js"></script>
...
  1. Add dependency to AngularJS module
angular.module('your-app', ['ng-jsyaml']);
  1. Inject yaml service and voila!
angular.module('your-app')
  .controller('YourController', YourController)
  
YourController.$inject = ['yaml']
 
function YourController(yaml) {
  // your awesome code
  
  // use yaml here
  
  // more of your awesome code
}

API

parse (string [, options])

Alias of safeLoad of js-yaml

stringify (object [, options])

Alias of safeDump of js-yaml

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ng-jsyaml

Weekly Downloads

4

Version

0.0.3

License

MIT

Unpacked Size

4.35 kB

Total Files

6

Last publish

Collaborators

  • gmanrique