Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

us-formly-templates

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

us-formly-templates - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

1

bower.json
{
"name": "us-formly-templates",
"version": "1.0.1",
"homepage": "https://github.com/juliofabiane/us-formly-templates",

@@ -4,0 +5,0 @@ "description": "Extensão com templates para usar formly com bootstrap",

2

package.json
{
"name": "us-formly-templates",
"version": "1.0.1",
"version": "1.0.2",
"description": "Extensão com templates para usar formly com bootstrap",

@@ -5,0 +5,0 @@ "scripts": {

angular.module('usFormlyTemplates', [
'formly',
'formly',
'formlyBootstrap'

@@ -294,3 +294,70 @@ ])

});
//Image Upload
//Multi Checkbox Inline
formlyConfigProvider.setType({
name: 'imageUpload',
extends: 'input',
template: `
<div class="col-md-12">
<div class="form-group">
<label>{{to.label}}</label>
<input type="file" us-file-upload="fileUpload" ng-model="model[options.key]"/>
</div>
<div class="hbox hbox-auto-xs">
<div class="col">
<div class="wrapper-sm b-a bg-white m-r-xs m-b-xs">
<div class="bg-light" style="height:200px">
<img-crop
image="fileUpload"
result-image="myCroppedImage"
result-image-size="160"
area-type="{{cropType}}">
</img-crop>
</div>
</div>
</div>
<div class="col">
<div class="inline bg-white wrapper-sm b-a">
<div class="bg-light">
<img ng-src="{{myCroppedImage}}" />
</div>
</div>
</div>
</div>
<div class="btn-group m-t">
<label class="btn btn-default" ng-model="cropType" btn-radio="'circle'">Circulo</label>
<label class="btn btn-default" ng-model="cropType" btn-radio="'square'">Quadrado</label>
</div>
</div>`,
wrapper: ['bootstrapHasError'],
controller: ['$scope', function ($scope) {
$scope.myCroppedImage = '';
$scope.cropType = "circle";
}]
});
}
]);
])
.directive('usFileUpload', function() {
return {
restrict: 'A',
require: 'ngModel',
scope: {
usFileUpload: '='
},
link(scope, element) {
element.on('change', function(e) {
if (!e.target.files || !e.target.files[0]) {
return;
};
var reader = new FileReader();
reader.onload = function (evt) {
scope.$apply(function(scope) {
scope.usFileUpload = evt.target.result;
});
};
reader.readAsDataURL(e.target.files[0]);
});
}
};
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc