Skip to content

Instantly share code, notes, and snippets.

View alexisselorm's full-sized avatar

Alexis Selorm Gbeckor-Kove alexisselorm

View GitHub Profile
@alexisselorm
alexisselorm / app.module.ts
Created December 25, 2023 14:58
AppModule
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { ReactiveFormsModule } from '@angular/forms';
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
@NgModule({
declarations: [AppComponent],
@alexisselorm
alexisselorm / MyUploadAdapter.ts
Created December 25, 2023 17:48
Image Upload Adapter
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
import {
FileLoader,
UploadResponse,
} from '@ckeditor/ckeditor5-upload/src/filerepository';
// Image Upload
export default class MyUploadAdapter {
loader: FileLoader;
@alexisselorm
alexisselorm / ckeditor.ts
Created December 25, 2023 18:23
CKEditor config
/**
* @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
import { Bold, Italic, Underline } from '@ckeditor/ckeditor5-basic-styles';
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
@alexisselorm
alexisselorm / App component class file
Created December 25, 2023 22:20
app.component.ts
import { Component } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import Editor from 'ckeditor5/build/ckeditor';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
@alexisselorm
alexisselorm / app.component.ts
Created December 25, 2023 22:24
App component template file
<div>
<form [formGroup]="form" (ngSubmit)="onSubmit()">
<div>
<label for="title">Title</label>
<input name="title" id="title" type="text" formControlName="title" />
</div>
<div>
<label for="body">Body</label>
<ckeditor
[editor]="editor"
@alexisselorm
alexisselorm / ImageController.cs
Last active December 26, 2023 01:44
Image controller
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
namespace ckedior_image_upload_angular_net.Server.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class ImageController : ControllerBase
{
@alexisselorm
alexisselorm / proxy.conf.js
Created December 26, 2023 01:47
Proxy config
const PROXY_CONFIG = [
{
context: [
"/api",
"/images"
],
target: "https://localhost:7135",
secure: false
}
]