Giter Site home page Giter Site logo

kostyatretyak / ng-contenteditable Goto Github PK

View Code? Open in Web Editor NEW
38.0 7.0 15.0 405 KB

Angular v4+ contenteditable directive for compatibility with Angular forms

TypeScript 21.12% JavaScript 78.88%
contenteditable angular controlvalueaccessor angular-forms

ng-contenteditable's Introduction

ng-contenteditable's People

Contributors

kostyatretyak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-contenteditable's Issues

[FeatureRequest] conditional contenteditable

Hi, thanks for your awesome work. I would suggest a feature-request:

I would like to conditionally make an element editable by providing a boolean variable on which i can decide whether the element should be editable, e.g.:

content-element.html

<p *contenteditable="isEditable" [formControl]="myControl"></p>
export class ContentElementComponent implements OnInit {
	isEditable = false;
	myControl = new FormControl();
	ngOnInit() {
		if (userShouldEdit()) {
			this.isEditable = true;
		}
	}
} 

would that be possible or somehow a bad idea?

thanks in advance

test is not saved in IE

I'm using your directive and in IE 11 the text I edit is not saved in the component. (I didn't use any form)
in FF, chrome and Edge everything is OK.
here is the html:
<div #description class="property description" [(ngModel)]="cellDraft.description" contenteditable="true"></div>

License

Hello :)

Would you mind putting up a license for this project's code?

Thanks :)

Please add a @Pipe/@Directive/@Component annotation

Hello i am getting the above error when trying to build my app using angular 4.4.3.
It builds and runs fine in developer mode but fails to build in prod.

I know this has been raised before but if you are sure this isn't a problem with your package can you provide an example cli project that builds in prod mode?

propValueAccesor is misspelled

"Accessor" should have a double "s", as in NG_VALUE_ACCESSOR.

Caused me some confusion when I tried to set propValueAccessor and it didn't work! Thanks for providing the otherwise very helpful package. ๐Ÿ‘

Error after update angular

Hi, after angular update, the plugin throw exception and isn't build,

Check this:
imagen

 ERROR in ./node_modules/ng-contenteditable/src/index.ts
 Module build failed: Error: D:\Usuario\Documentos\git\alumni-app\alumniApp\node_modules\ng-contenteditable\src\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
 The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
     at AngularCompilerPlugin.getCompiledFile (D:\Usuario\Documentos\git\alumni-app\alumniApp\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:709:23)
     at plugin.done.then (D:\Usuario\Documentos\git\alumni-app\alumniApp\node_modules\@ngtools\webpack\src\loader.js:41:31)
    at process._tickCallback (internal/process/next_tick.js:68:7)

But the file is in the correct location

I'm not sure why is show this error :/

Best regards.

Error: Please add a @Pipe/@Directive/@Component annotation

Hi,

My name is Rafael. Need help with my Angular 4 application.

ng-contenteditable is working just fine when I am running my app using ng serve but when I try to run ng build --prod, I get this error Error: Please add a @Pipe/@Directive/@Component annotation

What am I doing wrong?

Here is the complete error from my terminal:

ERROR in Error: Unexpected value 'ContenteditableDirective in /home/rafael/node/c/node_modules/ng-contenteditable/dist/index.d.ts' declared by the module 'AppModule in /home/rafael/node/c/src/app/app.module.ts'. Please add a @Pipe/@Directive/@component annotation.
at syntaxError (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
at /home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:15630:40
at Array.forEach ()
at CompileMetadataResolver.getNgModuleMetadata (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:15612:54)
at addNgModule (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:24408:58)
at /home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:24419:14
at Array.forEach ()
at _createNgModules (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:24418:26)
at analyzeNgModules (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:24293:14)
at analyzeAndValidateNgModules (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:24303:35)
at AotCompiler.analyzeModulesAsync (/home/rafael/node/c/node_modules/@angular/compiler/bundles/compiler.umd.js:23937:46)
at CodeGenerator.codegen (/home/rafael/node/c/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (/home/rafael/node/c/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
at _donePromise.Promise.resolve.then (/home/rafael/node/c/node_modules/@ngtools/webpack/src/plugin.js:386:44)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

Getting an error when using this - angular 5

Just trying this out and getting this error - using the latest Angular 5 / CLI:

ERROR in Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 404:52 in the original .ts file), resolving symbol Directive in /Users/bostondevin/Desktop/mgx/node_modules/ng-contenteditable/node_modules/@angular/core/core.d.ts, resolving symbol ContenteditableDirective in /Users/bostondevin/Desktop/mgx/node_modules/ng-contenteditable/src/index.ts, resolving symbol ContenteditableDirective in /Users/bostondevin/Desktop/mgx/node_modules/ng-contenteditable/src/index.ts

I think it's related to using the angular CLI - angular/angular-cli#3707

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.