quipu-util-front
v0.0.4
Published
Utils for projects in angularjs
Downloads
2
Readme
quipu-util-front
Utils for Angular
Description
This library contains Utils for AngulaJs
Installation
we assume you have pre-installed node.js and npm.
npm install -S quipu-util-front
Quick Start
Import in your project:
var App = angular.module('App', [
...
'QuipuUtilFront',
...
]);
You can also use
'QuipuUtilFront.DirectivesModule'
'QuipuUtilFront.FiltersModule'
'QuipuUtilFront.ServicesModule'
Example usage:
class exampleController{
construtor(dateQuipu){
this.dateQuipu = dateQuipu;
}
$onInit(){
let date = new Date("06/12/2017");
let dateStr = this.dateQuipu.dateToString(date, '-');
console.log(dataStr)// "12/06/2017
}
}
Services
dateQuipu
stringToDate
Convert String to Date
stringToDate(dateStr, splitter='/')
- dateStr: date in string format.
- splitter(optional): Splitter in string input.
dateToString
Convert Date to String
dateToString(date, splitter='/')
- date: date object.
- splitter(optional): Splitter in string output.
fileQuipu
base64ToArrayBuffer
Convert base64 to ArrayBuffer
base64ToArrayBuffer(base64)
- base64: String base64.
downloadFromFileObj
Download From File Object
downloadFromFileObj(file)
- file: File object.
file = {
filetype: 'application/pdf',
filename: 'filename',
base64: 'base64'
}
inputQuipu
onlyNumbers
Valid only be number
onlyNumbers(event)
- event: Angular event.
License
MIT © Fredy Romero Sam - Quipucamayoc RRHH