Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
- use styleUrls to replace import *.css
- rm no-style module support

Breaking change:
you should modify your config of `simplemde.min.css` from `style-loader` to `raw-loader` or other.
  • Loading branch information
doxiaodong committed Jul 28, 2017
1 parent 40ffc17 commit 4ee248d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,3 @@ export class AppModule { }

> 1. The final options is `{...$options1, ...$options2}`, `Object.assign({}, $options1, $options2)`
> 2. The `element` option is not useful
# Style

* normal, it use `import 'simplemde/dist/simplemde.min.css'`
* you can use a cdn
```
import { SimplemdeModule, SIMPLEMDE_CONFIG } from 'ng2-simplemde/no-style'
```
and in index.html

```
<link href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css" rel="stylesheet">
```
* Bundles use don't support this
2 changes: 1 addition & 1 deletion config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function webpackConfig() {
{ test: /\.ts$/, use: 'awesome-typescript-loader', exclude: [/\.(spec|e2e)\.ts$/] },
// See: https://github.com/webpack/raw-loader
{ test: /\.html$/, use: 'raw-loader', exclude: [path.resolve(__dirname, 'server/index.html')] },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] }
{ test: /\.css$/, use: 'raw-loader' }
]
},

Expand Down
2 changes: 0 additions & 2 deletions no-style.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "https://github.com/doxiaodong/ng2-simplemde"
},
"version": "1.1.0",
"version": "1.2.0",
"license": "MIT",
"main": "bundles/ng2-simplemde.umd.min.js",
"module": "index.js",
Expand Down
6 changes: 4 additions & 2 deletions src/simplemde.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
Input,
OnDestroy,
ModuleWithProviders,
Inject
Inject,
ViewEncapsulation
} from '@angular/core'
import {
NG_VALUE_ACCESSOR
Expand All @@ -27,13 +28,14 @@ const SIMPLEMDE_CONTROL_VALUE_ACCESSOR: any = {

@Component({
selector: 'simplemde',
encapsulation: ViewEncapsulation.None,
template: `
<textarea #simplemde></textarea>
`,
providers: [
SIMPLEMDE_CONTROL_VALUE_ACCESSOR
],
styleUrls: ['simplemde/dist/simplemde.min.css']
styleUrls: ['../node_modules/simplemde/dist/simplemde.min.css']
})
export class Simplemde extends NgModelBase implements AfterViewInit, OnDestroy {
@ViewChild('simplemde') textarea: ElementRef
Expand Down

0 comments on commit 4ee248d

Please sign in to comment.