Skip to content

Commit d96c26e

Browse files
author
Matt Lewis
committed
feat: upgrade to angular 6
BREAKING CHANGE: angular 6 and rxjs 6 or higher are now required to use this package Closes #31
1 parent 230016b commit d96c26e

12 files changed

+481
-307
lines changed

.prettierrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"parser": "typescript",
32
"singleQuote": true
4-
}
3+
}

README.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# angular 5.0+ drag and drop
1+
# angular 6.0+ drag and drop
2+
23
[![Build Status](https://travis-ci.org/mattlewis92/angular-draggable-droppable.svg?branch=master)](https://travis-ci.org/mattlewis92/angular-draggable-droppable)
34
[![codecov](https://codecov.io/gh/mattlewis92/angular-draggable-droppable/branch/master/graph/badge.svg)](https://codecov.io/gh/mattlewis92/angular-draggable-droppable)
45
[![npm version](https://badge.fury.io/js/angular-draggable-droppable.svg)](http://badge.fury.io/js/angular-draggable-droppable)
@@ -8,23 +9,25 @@
89
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/mattlewis92/angular-draggable-droppable/master/LICENSE)
910

1011
## Demo
12+
1113
https://mattlewis92.github.io/angular-draggable-droppable/demo/
1214

1315
## Table of contents
1416

15-
- [About](#about)
16-
- [Installation](#installation)
17-
- [Documentation](#documentation)
18-
- [Development](#development)
19-
- [License](#licence)
17+
* [About](#about)
18+
* [Installation](#installation)
19+
* [Documentation](#documentation)
20+
* [Development](#development)
21+
* [License](#licence)
2022

2123
## About
2224

23-
Observable powered drag and drop for angular 5.0+
25+
Observable powered drag and drop for angular 6.0+
2426

2527
## Installation
2628

2729
Install through npm:
30+
2831
```
2932
npm install --save angular-draggable-droppable
3033
```
@@ -55,35 +58,38 @@ class DemoModule {}
5558
`
5659
})
5760
class DemoApp {
58-
5961
droppedData: string;
6062

6163
dragEnd(event) {
6264
console.log('Element was dragged', event);
6365
}
64-
6566
}
6667
```
6768

6869
You may also find it useful to view the [demo source](https://github.com/mattlewis92/angular-draggable-droppable/blob/master/demo/demo.component.ts).
6970

7071
## Documentation
72+
7173
All documentation is auto-generated from the source and can be viewed here:
7274
https://mattlewis92.github.io/angular-draggable-droppable/docs/
7375

7476
## Development
7577

7678
### Prepare your environment
79+
7780
* Install [Node.js](http://nodejs.org/) and NPM (should come with)
7881
* Install local dev dependencies: `npm install` while current directory is this repo
7982

8083
### Development server
84+
8185
Run `npm start` to start a development server on port 8000 with auto reload + tests.
8286

8387
### Testing
88+
8489
Run `npm test` to run tests once or `npm run test:watch` to continually run tests.
8590

8691
### Release
92+
8793
```bash
8894
npm run release
8995
```

demo/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<meta http-equiv="x-ua-compatible" content="ie=edge">
77
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
8-
<title>angular 5.0+ drag and drop</title>
8+
<title>angular 6.0+ drag and drop</title>
99
</head>
1010
<body>
1111

@@ -20,7 +20,7 @@
2020
<nav class="navbar navbar-default" role="navigation">
2121
<div class="container-fluid">
2222
<div class="navbar-header">
23-
<a class="navbar-brand" href="#">angular 5.0+ drag and drop</a>
23+
<a class="navbar-brand" href="#">angular 6.0+ drag and drop</a>
2424
</div>
2525
<ul class="nav navbar-nav hidden-xs">
2626
<li><a href="#demo">Demo</a></li>

karma.conf.ts

+31-29
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as webpack from 'webpack';
22

33
export default function(config: any) {
44
config.set({
5-
65
// base path that will be used to resolve all patterns (eg. files, exclude)
76
basePath: './',
87

@@ -11,9 +10,7 @@ export default function(config: any) {
1110
frameworks: ['mocha'],
1211

1312
// list of files / patterns to load in the browser
14-
files: [
15-
'test/entry.ts'
16-
],
13+
files: ['test/entry.ts'],
1714

1815
// preprocess matching files before serving them to the browser
1916
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
@@ -27,38 +24,43 @@ export default function(config: any) {
2724
extensions: ['.ts', '.js']
2825
},
2926
module: {
30-
rules: [{
31-
test: /\.ts$/,
32-
loader: 'tslint-loader',
33-
exclude: /node_modules/,
34-
enforce: 'pre',
35-
options: {
36-
emitErrors: config.singleRun,
37-
failOnHint: config.singleRun
38-
}
39-
}, {
40-
test: /\.ts$/,
41-
loader: 'ts-loader',
42-
exclude: /node_modules/
43-
}, {
44-
test: /src\/.+\.ts$/,
45-
exclude: /(test|node_modules)/,
46-
loader: 'istanbul-instrumenter-loader',
47-
enforce: 'post'
48-
}, {
49-
test: /node_modules\/@angular\/core\/.+\/core\.js$/,
50-
parser: {
51-
system: true // disable `System.import() is deprecated and will be removed soon. Use import() instead.` warning
27+
rules: [
28+
{
29+
test: /\.ts$/,
30+
loader: 'tslint-loader',
31+
exclude: /node_modules/,
32+
enforce: 'pre',
33+
options: {
34+
emitErrors: config.singleRun,
35+
failOnHint: config.singleRun
36+
}
37+
},
38+
{
39+
test: /\.ts$/,
40+
loader: 'ts-loader',
41+
exclude: /node_modules/
42+
},
43+
{
44+
test: /src\/.+\.ts$/,
45+
exclude: /(test|node_modules)/,
46+
loader: 'istanbul-instrumenter-loader',
47+
enforce: 'post'
48+
},
49+
{
50+
test: /node_modules\/@angular\/core\/.+\/core\.js$/,
51+
parser: {
52+
system: true // disable `System.import() is deprecated and will be removed soon. Use import() instead.` warning
53+
}
5254
}
53-
}]
55+
]
5456
},
5557
plugins: [
5658
new webpack.SourceMapDevToolPlugin({
5759
filename: null,
5860
test: /\.(ts|js)($|\?)/i
5961
}),
6062
new webpack.ContextReplacementPlugin(
61-
/angular(\\|\/)core(\\|\/)esm5/,
63+
/angular(\\|\/)core(\\|\/)fesm5/,
6264
__dirname + '/src'
6365
)
6466
],
@@ -91,4 +93,4 @@ export default function(config: any) {
9193
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
9294
browsers: ['ChromeHeadless']
9395
});
94-
};
96+
}

0 commit comments

Comments
 (0)