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

angular-froala-wysiwyg-base

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-froala-wysiwyg-base - npm Package Compare versions

Comparing version 3.1.1 to 3.2.1-1

.tmp/editor/editor.directive.ts

4

package.json
{
"name": "angular-froala-wysiwyg-base",
"version": "3.1.1",
"version": "3.2.1-1",
"description": "Angular 4, 5, 6, 7, 8 and 9 bindings for Froala WYSIWYG HTML rich text editor",

@@ -53,3 +53,3 @@ "main": "bundles/angular-froala-wysiwyg.umd.js",

"font-awesome": "^4.7.0",
"froala-editor": "^3.1.1",
"froala-editor": "^3.2.1",
"tslib": "^1.9.0"

@@ -56,0 +56,0 @@ },

import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
import { Directive, ElementRef, EventEmitter, Input, NgZone, Optional, Output, Renderer, forwardRef } from '@angular/core';
import { Directive, ElementRef, EventEmitter, Input, NgZone, Output, forwardRef } from '@angular/core';

@@ -67,5 +67,54 @@ import FroalaEditor from 'froala-editor';

@Input() set froalaEditor(opts: any) {
this._opts = opts || this._opts;
this._opts = this.clone( opts || this._opts);
this._opts = {...this._opts};
}
// TODO: replace clone method with better possible alternate
private clone(item) {
const me = this;
if (!item) { return item; } // null, undefined values check
let types = [ Number, String, Boolean ],
result;
// normalizing primitives if someone did new String('aaa'), or new Number('444');
types.forEach(function(type) {
if (item instanceof type) {
result = type( item );
}
});
if (typeof result == "undefined") {
if (Object.prototype.toString.call( item ) === "[object Array]") {
result = [];
item.forEach(function(child, index, array) {
result[index] = me.clone( child );
});
} else if (typeof item == "object") {
// testing that this is DOM
if (item.nodeType && typeof item.cloneNode == "function") {
result = item.cloneNode( true );
} else if (!item.prototype) { // check that this is a literal
if (item instanceof Date) {
result = new Date(item);
} else {
// it is an object literal
result = {};
for (var i in item) {
result[i] = me.clone( item[i] );
}
}
} else {
if (false && item.constructor) {
result = new item.constructor();
} else {
result = item;
}
}
} else {
result = item;
}
}
return result;
}
// froalaModel directive as input: store initial editor content

@@ -72,0 +121,0 @@ @Input() set froalaModel(content: any) {

@@ -11,5 +11,5 @@ import { NgModule, ModuleWithProviders } from '@angular/core';

export class FroalaEditorModule {
public static forRoot(): ModuleWithProviders {
public static forRoot(): ModuleWithProviders<FroalaEditorModule> {
return {ngModule: FroalaEditorModule, providers: []};
}
}
{
"name": "angular-froala-wysiwyg",
"version": "3.1.1",
"version": "3.2.1",
"dependencies": {
"froala-editor": "3.1.1"
"froala-editor": "3.2.1"
}
}

@@ -10,5 +10,5 @@ import { NgModule, ModuleWithProviders } from '@angular/core';

export class FroalaViewModule {
public static forRoot(): ModuleWithProviders {
public static forRoot(): ModuleWithProviders<FroalaViewModule> {
return {ngModule: FroalaViewModule, providers: []};
}
}
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