Comments (4)
Same problem here while dealing with styles. I am using Angular 4.2.5 with Copy Web Pack plugin v 4.0.1.
Can anyone help with resolving this.. Thanks.
from tinymce-angular.
You can't load a sass file into tinymce, so that will never work.
from tinymce-angular.
I am posting my work-around here if anyone else has the need to compile there .sass files to .css and use it in tinymce
- Create a gulp file with a task to compile the .sass file to .css
- Add the gulp file to be called when the
ng-build
orng-serve
command fires - Point the
content_css
property to the compiled .css file
Here is my gulp file, replace $project_id with your project name
'use strict';
var args = getCommandLineArguments(process.argv);
var gulp = require('gulp');
var sass = require('gulp-sass');
sass.compiler = require('node-sass');
gulp.task('tinymcesass', function () {
return gulp.src('./src/assets/sass/tinymce.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(isProd(args.env) ? './dist/$project_id/assets/' : './src/assets/'));
});
gulp.task('tinymcesass:watch', function () {
gulp.watch('./src/assets/sass/tinymce.scss', ['tinymcesass']);
});
gulp.task('tinymce', ['tinymcesass']);
// https://www.sitepoint.com/pass-parameters-gulp-tasks/
// fetch command line arguments
function getCommandLineArguments(argList) {
let arg = {}, a, opt, thisOpt, curOpt;
for (a = 0; a < argList.length; a++) {
thisOpt = argList[a].trim();
opt = thisOpt.replace(/^\-+/, '');
if (opt === thisOpt) {
// argument value
if (curOpt) arg[curOpt] = opt;
curOpt = null;
}
else {
// argument name
curOpt = opt;
arg[curOpt] = true;
}
}
return arg;
}
function isProd(env) {
return env === 'prod';
}
Here is my package.json script section:
"prestart": "gulp tinymce --env dev",
"start": "ng serve",
"build": "ng build",
"postbuild": "gulp tinymce --env prod",
The --env
argument is so that the .css file ends up in the correct location for when you are running locally or production
Here is my config object
{
skin_url: '/assets/plugins/tinymce/skins/lightgray',
content_css: `/assets/tinymce.css?v=${Date.now()}`,
height: '480',
branding: false,
}
Date.now()
is used for cache busting.
from tinymce-angular.
Same problem here while dealing with styles. I am using Angular 4.2.5 with Copy Web Pack plugin v 4.0.1.
Can anyone help with resolving this.. Thanks.
Please see my proposed work-around
from tinymce-angular.
Related Issues (20)
- Issue when integrating TinyMCE Angular v7 with Angular v15 and ABP v7 HOT 2
- Form control not updated with changes in the "code" plugin HOT 3
- Version HOT 3
- Tiny mce content is not available inside ngOndestroy life cycle Angular HOT 6
- [disabled]="true" not working with angular v15. HOT 6
- Inline TinyMCE toolbar is 1 pixel too small in width, forcing itself to create another toolbar row for no reason HOT 2
- Angular 15, Ionic 6, capacitor 4 iOS app, TinyMCE editor referrer header missing issue for review
- Angular 15, Ionic 6, capacitor 4 iOS app, TinyMCE editor referrer header missing issue for review
- Angular 15, Ionic 6, capacitor 4 iOS app, TinyMCE editor referrer header missing issue for review
- Angular 15, Ionic 6, capacitor 4 iOS app, TinyMCE editor referrer header missing issue for review HOT 1
- Getting ESMA Script issue in angular HOT 2
- Update TinyMce HOT 2
- How do I add a custom button to the toolbar? HOT 2
- NS_ERROR_UNEXPECTED on Firefox browser after saving the editor content. HOT 1
- OnChange and onFocusOut event HOT 1
- @tinymce/tinymce-angular V7.0.0 has abnormal behavior with external scrollbar when pressing Enter. HOT 2
- Angular does not detect changes with events from the `<editor>` component HOT 5
- Set max character limit without including internal format HOT 2
- βFormatβ menu not working in Safari HOT 5
- Angular - declare tinymce init error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinymce-angular.