├── .editorconfig
├── .firebaserc
├── .gitignore
├── README.md
├── angular.json
├── browserslist
├── e2e
├── protractor.conf.js
├── src
│ ├── app.e2e-spec.ts
│ └── app.po.ts
└── tsconfig.json
├── firebase.json
├── karma.conf.js
├── package-lock.json
├── package.json
├── projects
└── ngx-circular-player
│ ├── README.md
│ ├── karma.conf.js
│ ├── ng-package.json
│ ├── package.json
│ ├── src
│ ├── lib
│ │ ├── ngx-circular-player.component.css
│ │ ├── ngx-circular-player.component.html
│ │ ├── ngx-circular-player.component.ts
│ │ └── ngx-circular-player.module.ts
│ ├── public-api.ts
│ └── test.ts
│ ├── tsconfig.lib.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── server.ts
├── src
├── app
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.component.spec.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ └── app.server.module.ts
├── assets
│ └── .gitkeep
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── main.server.ts
├── main.ts
├── polyfills.ts
├── styles.css
└── test.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.server.json
├── tsconfig.spec.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "targets": {
3 | "ngx-circular-player": {
4 | "hosting": {
5 | "ngx-circular-player-demo": [
6 | "ngx-circular-player"
7 | ]
8 | }
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events*.json
15 | speed-measure-plugin*.json
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 |
26 | # IDE - VSCode
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 | .history/*
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 | .firebase
48 |
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NgxCircularPlayer
2 |
3 | A circular player for Angular. Demo available at https://ngx-circular-player.firebaseapp.com/.
4 |
5 | ## Usage
6 |
7 | ```bash
8 | npm i ngx-circular-player --save
9 | ```
10 |
11 | After that in your `AppModule`:
12 |
13 | ```ts
14 | import { NgxCircularPlayerModule } from 'ngx-circular-player';
15 |
16 | @NgModule({
17 | imports: [NgxCircularPlayerModule],
18 | ...
19 | })
20 | export class AppModule {}
21 | ```
22 |
23 | You can use the player in your template by:
24 |
25 | ```html
26 |
27 | ```
28 |
29 | ## Configuration
30 |
31 | You can specify the following inputs:
32 |
33 | - `source` - Specifies the audio file.
34 | - `radius` - Specifies the radius of the player. Default value `120`.
35 | - `stroke` - Specifies the stroke width. Default value `20`.
36 | - `innerStroke` - Specifies the inner stroke width. Default value `2`.
37 | - `strokeColor` - Specifies the stroke color. Default value `#fff`.
38 | - `progressStrokeColor` - Specifies the color of the stroke indicating the progress. Default value `#858585`.
39 | - `innerStrokeColor` - Specifies the inner stroke color. Default value `#eee`.
40 |
41 | ## License
42 |
43 | MIT
44 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "ngx-circular-player-demo": {
7 | "projectType": "application",
8 | "schematics": {},
9 | "root": "",
10 | "sourceRoot": "src",
11 | "prefix": "app",
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/ngx-circular-player-demo/browser",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "tsconfig.app.json",
21 | "aot": true,
22 | "assets": [
23 | "src/favicon.ico",
24 | "src/assets"
25 | ],
26 | "styles": [
27 | "src/styles.css"
28 | ],
29 | "scripts": []
30 | },
31 | "configurations": {
32 | "production": {
33 | "fileReplacements": [
34 | {
35 | "replace": "src/environments/environment.ts",
36 | "with": "src/environments/environment.prod.ts"
37 | }
38 | ],
39 | "optimization": true,
40 | "outputHashing": "all",
41 | "sourceMap": false,
42 | "extractCss": true,
43 | "namedChunks": false,
44 | "extractLicenses": true,
45 | "vendorChunk": false,
46 | "buildOptimizer": true,
47 | "budgets": [
48 | {
49 | "type": "initial",
50 | "maximumWarning": "2mb",
51 | "maximumError": "5mb"
52 | },
53 | {
54 | "type": "anyComponentStyle",
55 | "maximumWarning": "6kb",
56 | "maximumError": "10kb"
57 | }
58 | ]
59 | }
60 | }
61 | },
62 | "serve": {
63 | "builder": "@angular-devkit/build-angular:dev-server",
64 | "options": {
65 | "browserTarget": "ngx-circular-player-demo:build"
66 | },
67 | "configurations": {
68 | "production": {
69 | "browserTarget": "ngx-circular-player-demo:build:production"
70 | }
71 | }
72 | },
73 | "extract-i18n": {
74 | "builder": "@angular-devkit/build-angular:extract-i18n",
75 | "options": {
76 | "browserTarget": "ngx-circular-player-demo:build"
77 | }
78 | },
79 | "test": {
80 | "builder": "@angular-devkit/build-angular:karma",
81 | "options": {
82 | "main": "src/test.ts",
83 | "polyfills": "src/polyfills.ts",
84 | "tsConfig": "tsconfig.spec.json",
85 | "karmaConfig": "karma.conf.js",
86 | "assets": [
87 | "src/favicon.ico",
88 | "src/assets"
89 | ],
90 | "styles": [
91 | "src/styles.css"
92 | ],
93 | "scripts": []
94 | }
95 | },
96 | "lint": {
97 | "builder": "@angular-devkit/build-angular:tslint",
98 | "options": {
99 | "tsConfig": [
100 | "tsconfig.app.json",
101 | "tsconfig.spec.json",
102 | "e2e/tsconfig.json"
103 | ],
104 | "exclude": [
105 | "**/node_modules/**"
106 | ]
107 | }
108 | },
109 | "e2e": {
110 | "builder": "@angular-devkit/build-angular:protractor",
111 | "options": {
112 | "protractorConfig": "e2e/protractor.conf.js",
113 | "devServerTarget": "ngx-circular-player-demo:serve"
114 | },
115 | "configurations": {
116 | "production": {
117 | "devServerTarget": "ngx-circular-player-demo:serve:production"
118 | }
119 | }
120 | },
121 | "deploy": {
122 | "builder": "@angular/fire:deploy",
123 | "options": {
124 | "buildTarget": "ngx-circular-player-demo:prerender:production"
125 | }
126 | },
127 | "server": {
128 | "builder": "@angular-devkit/build-angular:server",
129 | "options": {
130 | "outputPath": "dist/ngx-circular-player-demo/server",
131 | "main": "server.ts",
132 | "tsConfig": "tsconfig.server.json"
133 | },
134 | "configurations": {
135 | "production": {
136 | "outputHashing": "media",
137 | "fileReplacements": [
138 | {
139 | "replace": "src/environments/environment.ts",
140 | "with": "src/environments/environment.prod.ts"
141 | }
142 | ],
143 | "sourceMap": false,
144 | "optimization": true
145 | }
146 | }
147 | },
148 | "serve-ssr": {
149 | "builder": "@nguniversal/builders:ssr-dev-server",
150 | "options": {
151 | "browserTarget": "ngx-circular-player-demo:build",
152 | "serverTarget": "ngx-circular-player-demo:server"
153 | },
154 | "configurations": {
155 | "production": {
156 | "browserTarget": "ngx-circular-player-demo:build:production",
157 | "serverTarget": "ngx-circular-player-demo:server:production"
158 | }
159 | }
160 | },
161 | "prerender": {
162 | "builder": "@nguniversal/builders:prerender",
163 | "options": {
164 | "browserTarget": "ngx-circular-player-demo:build:production",
165 | "serverTarget": "ngx-circular-player-demo:server:production",
166 | "routes": [
167 | "/"
168 | ]
169 | },
170 | "configurations": {
171 | "production": {}
172 | }
173 | }
174 | }
175 | },
176 | "ngx-circular-player": {
177 | "projectType": "library",
178 | "root": "projects/ngx-circular-player",
179 | "sourceRoot": "projects/ngx-circular-player/src",
180 | "prefix": "lib",
181 | "architect": {
182 | "build": {
183 | "builder": "@angular-devkit/build-ng-packagr:build",
184 | "options": {
185 | "tsConfig": "projects/ngx-circular-player/tsconfig.lib.json",
186 | "project": "projects/ngx-circular-player/ng-package.json"
187 | },
188 | "configurations": {
189 | "production": {
190 | "tsConfig": "projects/ngx-circular-player/tsconfig.lib.prod.json"
191 | }
192 | }
193 | },
194 | "test": {
195 | "builder": "@angular-devkit/build-angular:karma",
196 | "options": {
197 | "main": "projects/ngx-circular-player/src/test.ts",
198 | "tsConfig": "projects/ngx-circular-player/tsconfig.spec.json",
199 | "karmaConfig": "projects/ngx-circular-player/karma.conf.js"
200 | }
201 | },
202 | "lint": {
203 | "builder": "@angular-devkit/build-angular:tslint",
204 | "options": {
205 | "tsConfig": [
206 | "projects/ngx-circular-player/tsconfig.lib.json",
207 | "projects/ngx-circular-player/tsconfig.spec.json"
208 | ],
209 | "exclude": [
210 | "**/node_modules/**"
211 | ]
212 | }
213 | }
214 | }
215 | }
216 | },
217 | "defaultProject": "ngx-circular-player-demo",
218 | "cli": {
219 | "analytics": "d2cd07ee-aab6-440b-9395-6828ff8a189f"
220 | }
221 | }
222 |
--------------------------------------------------------------------------------
/browserslist:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # You can see what browsers were selected by your queries by running:
6 | # npx browserslist
7 |
8 | > 0.5%
9 | last 2 versions
10 | Firefox ESR
11 | not dead
12 | not IE 9-11 # For IE 9-11 support, remove 'not'.
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | // Protractor configuration file, see link for more information
3 | // https://github.com/angular/protractor/blob/master/lib/config.ts
4 |
5 | const { SpecReporter } = require('jasmine-spec-reporter');
6 |
7 | /**
8 | * @type { import("protractor").Config }
9 | */
10 | exports.config = {
11 | allScriptsTimeout: 11000,
12 | specs: [
13 | './src/**/*.e2e-spec.ts'
14 | ],
15 | capabilities: {
16 | browserName: 'chrome'
17 | },
18 | directConnect: true,
19 | baseUrl: 'http://localhost:4200/',
20 | framework: 'jasmine',
21 | jasmineNodeOpts: {
22 | showColors: true,
23 | defaultTimeoutInterval: 30000,
24 | print: function() {}
25 | },
26 | onPrepare() {
27 | require('ts-node').register({
28 | project: require('path').join(__dirname, './tsconfig.json')
29 | });
30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31 | }
32 | };
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 | import { browser, logging } from 'protractor';
3 |
4 | describe('workspace-project App', () => {
5 | let page: AppPage;
6 |
7 | beforeEach(() => {
8 | page = new AppPage();
9 | });
10 |
11 | it('should display welcome message', () => {
12 | page.navigateTo();
13 | expect(page.getTitleText()).toEqual('ngx-circular-player app is running!');
14 | });
15 |
16 | afterEach(async () => {
17 | // Assert that there are no errors emitted from the browser
18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19 | expect(logs).not.toContain(jasmine.objectContaining({
20 | level: logging.Level.SEVERE,
21 | } as logging.Entry));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get(browser.baseUrl) as Promise;
6 | }
7 |
8 | getTitleText() {
9 | return element(by.css('app-root .content span')).getText() as Promise;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": [
3 | {
4 | "target": "ngx-circular-player-demo",
5 | "public": "dist/ngx-circular-player-demo/browser",
6 | "ignore": [
7 | "firebase.json",
8 | "**/.*",
9 | "**/node_modules/**"
10 | ],
11 | "rewrites": [
12 | {
13 | "source": "**",
14 | "destination": "/index.html"
15 | }
16 | ]
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, './coverage/ngx-circular-player-demo'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ngx-circular-player-demo",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e",
11 | "dev:ssr": "ng run ngx-circular-player-demo:serve-ssr",
12 | "serve:ssr": "node dist/ngx-circular-player-demo/server/main.js",
13 | "build:ssr": "ng build --prod && ng run ngx-circular-player-demo:server:production",
14 | "prerender": "ng run ngx-circular-player-demo:prerender"
15 | },
16 | "private": true,
17 | "dependencies": {
18 | "@angular/animations": "~9.0.0-rc.8",
19 | "@angular/common": "~9.0.0-rc.8",
20 | "@angular/compiler": "~9.0.0-rc.8",
21 | "@angular/core": "~9.0.0-rc.8",
22 | "@angular/fire": "^5.4.2",
23 | "@angular/forms": "~9.0.0-rc.8",
24 | "@angular/platform-browser": "~9.0.0-rc.8",
25 | "@angular/platform-browser-dynamic": "~9.0.0-rc.8",
26 | "@angular/platform-server": "~9.0.0-rc.8",
27 | "@angular/router": "~9.0.0-rc.8",
28 | "@nguniversal/express-engine": "^9.0.1",
29 | "express": "^4.15.2",
30 | "firebase": ">= 5.5.7 <8",
31 | "rxjs": "~6.5.3",
32 | "tslib": "^1.10.0",
33 | "zone.js": "~0.10.2"
34 | },
35 | "devDependencies": {
36 | "@angular-devkit/build-angular": "~0.900.0-rc.8",
37 | "@angular-devkit/build-ng-packagr": "~0.900.5",
38 | "@angular/cli": "~9.0.0-rc.8",
39 | "@angular/compiler-cli": "~9.0.0-rc.8",
40 | "@angular/language-service": "~9.0.0-rc.8",
41 | "@nguniversal/builders": "^9.0.1",
42 | "@types/express": "^4.17.0",
43 | "@types/node": "^12.11.1",
44 | "@types/jasmine": "~3.5.0",
45 | "@types/jasminewd2": "~2.0.3",
46 | "codelyzer": "^5.1.2",
47 | "jasmine-core": "~3.5.0",
48 | "jasmine-spec-reporter": "~4.2.1",
49 | "karma": "~4.3.0",
50 | "karma-chrome-launcher": "~3.1.0",
51 | "karma-coverage-istanbul-reporter": "~2.1.0",
52 | "karma-jasmine": "~2.0.1",
53 | "karma-jasmine-html-reporter": "^1.4.2",
54 | "ng-packagr": "^9.0.0",
55 | "protractor": "~5.4.2",
56 | "ts-node": "~8.3.0",
57 | "tslint": "~5.18.0",
58 | "typescript": "~3.6.4",
59 | "@angular-devkit/architect": "<0.900 || ^0.900.0-0 || ^9.0.0-0",
60 | "firebase-tools": "^7.12.0",
61 | "fuzzy": "^0.1.3",
62 | "inquirer": "^6.2.2",
63 | "inquirer-autocomplete-prompt": "^1.0.1"
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/README.md:
--------------------------------------------------------------------------------
1 | # NgxCircularPlayer
2 |
3 | A circular player for Angular. Demo available at https://ngx-circular-player.firebaseapp.com/.
4 |
5 | ## Usage
6 |
7 | ```bash
8 | npm i ngx-circular-player --save
9 | ```
10 |
11 | After that in your `AppModule`:
12 |
13 | ```ts
14 | import { NgxCircularPlayerModule } from 'ngx-circular-player';
15 |
16 | @NgModule({
17 | imports: [NgxCircularPlayerModule],
18 | ...
19 | })
20 | export class AppModule {}
21 | ```
22 |
23 | You can use the player in your template by:
24 |
25 | ```html
26 |
27 | ```
28 |
29 | ## Configuration
30 |
31 | You can specify the following inputs:
32 |
33 | - `source` - Specifies the audio file.
34 | - `radius` - Specifies the radius of the player. Default value `120`.
35 | - `stroke` - Specifies the stroke width. Default value `20`.
36 | - `innerStroke` - Specifies the inner stroke width. Default value `2`.
37 | - `strokeColor` - Specifies the stroke color. Default value `#fff`.
38 | - `progressStrokeColor` - Specifies the color of the stroke indicating the progress. Default value `#858585`.
39 | - `innerStrokeColor` - Specifies the inner stroke color. Default value `#eee`.
40 |
41 | ## License
42 |
43 | MIT
44 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../../coverage/ngx-circular-player'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/ngx-circular-player",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | }
7 | }
--------------------------------------------------------------------------------
/projects/ngx-circular-player/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ngx-circular-player",
3 | "version": "0.0.3",
4 | "peerDependencies": {
5 | "@angular/common": "^9.0.5",
6 | "@angular/core": "^9.0.5",
7 | "tslib": "^1.10.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/lib/ngx-circular-player.component.css:
--------------------------------------------------------------------------------
1 | svg {
2 | position: absolute;
3 | top: 50%;
4 | left: 50%;
5 | stroke: #fff;
6 | border-radius: 100%;
7 | transform: translate(-50%, -50%);
8 | pointer-events: none;
9 | z-index: 0;
10 | }
11 |
12 | svg path {
13 | cursor: pointer;
14 | }
15 |
16 | button {
17 | position: relative;
18 | }
19 |
20 | .play {
21 | position: absolute;
22 | top: 50%;
23 | left: 50%;
24 | z-index: 3;
25 | background: transparent !important;
26 | cursor: pointer;
27 | transform: translate(-50%, -50%);
28 | outline: none;
29 | border: none;
30 | }
31 |
32 | .arrow {
33 | transition: all 0.3s;
34 |
35 | width: 0;
36 | height: 0;
37 |
38 | border-top-color: transparent;
39 | border-top-style: solid;
40 | border-bottom-color: transparent;
41 | border-bottom-style: solid;
42 | border-left-style: solid;
43 | border-left-color: #eee;
44 |
45 | margin: auto;
46 | }
47 |
48 | .play,
49 | .pause {
50 | width: 100%;
51 | height: 100%;
52 | border-radius: 50%;
53 | }
54 |
55 | .pause {
56 | transition: opacity 0.3s;
57 | }
58 |
59 | /* Center */
60 | .play,
61 | .pause,
62 | .pause .before,
63 | .pause .after {
64 | position: absolute;
65 | top: 50%;
66 | left: 50%;
67 | transform: translate(-50%, -50%);
68 | }
69 |
70 | .pause .before,
71 | .pause .after {
72 | content: "";
73 | background-color: #eee;
74 | display: inline-block;
75 | opacity: 1;
76 | }
77 |
78 | .hidden-arrow {
79 | border-left-width: 0 !important;
80 | }
81 |
82 | .hidden {
83 | opacity: 0;
84 | }
85 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/lib/ngx-circular-player.component.html:
--------------------------------------------------------------------------------
1 |
11 |
37 |
38 |
41 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/lib/ngx-circular-player.component.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Component,
3 | Input,
4 | AfterViewInit,
5 | ViewChild,
6 | ElementRef,
7 | ChangeDetectionStrategy
8 | } from '@angular/core';
9 |
10 | const RADIUS = 50;
11 |
12 | @Component({
13 | // tslint:disable component-selector
14 | selector: 'ngx-circular-player',
15 | templateUrl: './ngx-circular-player.component.html',
16 | styleUrls: ['./ngx-circular-player.component.css'],
17 | changeDetection: ChangeDetectionStrategy.OnPush
18 | })
19 | export class NgxCircularPlayerComponent implements AfterViewInit {
20 | @Input() radius = 120;
21 | @Input() stroke = 20;
22 | @Input() innerStroke = 2;
23 | @Input() source: string;
24 | @Input() strokeColor = '#fff';
25 | @Input() progressStrokeColor = '#858585';
26 | @Input() innerStrokeColor = '#eee';
27 |
28 | @ViewChild('audio') audio: ElementRef;
29 | @ViewChild('progress') progress: ElementRef;
30 |
31 | playing = false;
32 |
33 | toggle() {
34 | this.playing = !this.playing;
35 | if (this.playing) {
36 | this.audio.nativeElement.play();
37 | } else {
38 | this.audio.nativeElement.pause();
39 | }
40 | }
41 |
42 | get arrowStyle() {
43 | const topWidth = this.radius / 8;
44 | const bottomWidth = this.radius / 8;
45 | const leftWidth = this.radius / 5;
46 | return {
47 | 'border-top-width': `${topWidth}px`,
48 | 'border-bottom-width': `${bottomWidth}px`,
49 | 'border-left-width': `${leftWidth}px`
50 | };
51 | }
52 |
53 | ngAfterViewInit() {
54 | const progress = this.progress.nativeElement;
55 | // During SSR we don't need to do anything special here.
56 | if (!progress || typeof progress.getTotalLength !== 'function') {
57 | return;
58 | }
59 | const totalLength = progress.getTotalLength();
60 | const audio = this.audio.nativeElement as HTMLAudioElement;
61 | progress.setAttribute('stroke-dasharray', totalLength);
62 | progress.setAttribute('stroke-dashoffset', totalLength);
63 | audio.addEventListener('pause', () => (this.playing = false));
64 | audio.addEventListener('play', () => (this.playing = true));
65 | audio.addEventListener('timeupdate', () => {
66 | const currentTime = audio.currentTime;
67 | const maxduration = audio.duration;
68 | const calc = totalLength - (currentTime / maxduration) * totalLength;
69 |
70 | progress.setAttribute('stroke-dashoffset', calc);
71 | });
72 | }
73 |
74 | seek(evnt: MouseEvent) {
75 | const ratio = this._calculateAngle(evnt) / 360;
76 | const audio = this.audio.nativeElement as HTMLAudioElement;
77 | const seekTo = ratio * audio.duration;
78 | audio.currentTime = seekTo;
79 | }
80 |
81 | get centerX() {
82 | return 50;
83 | }
84 |
85 | get centerY() {
86 | return 50;
87 | }
88 |
89 | get circleRadius() {
90 | return 32;
91 | }
92 |
93 | get pauseLeftBarSize() {
94 | return {
95 | width: `${this.radius / 10}px`,
96 | height: `${this.radius / 3.5}px`,
97 | left: `calc(50% - ${this.radius / 12}px)`
98 | };
99 | }
100 |
101 | get pauseRightBarSize() {
102 | return {
103 | width: `${this.radius / 10}px`,
104 | height: `${this.radius / 3.5}px`,
105 | left: `calc(50% + ${this.radius / 12}px)`
106 | };
107 | }
108 |
109 | get playButtonRadius() {
110 | return this.radius - this.radius / 3 + 'px';
111 | }
112 |
113 | private _calculateAngle(evnt: MouseEvent) {
114 | const x = (RADIUS * 2) / (this.radius / evnt.offsetX);
115 | const y = (RADIUS * 2) / (this.radius / evnt.offsetY);
116 | const slope = (RADIUS - y) / (RADIUS - x);
117 | const angle = 180 * (Math.abs(Math.atan(slope)) / Math.PI);
118 |
119 | if (x <= RADIUS && y >= RADIUS) {
120 | return angle;
121 | }
122 | if (x > RADIUS && y >= RADIUS) {
123 | return 180 - angle;
124 | }
125 | if (x > RADIUS && y <= RADIUS) {
126 | return 180 + angle;
127 | }
128 | return 180 + (180 - angle);
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/lib/ngx-circular-player.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { NgxCircularPlayerComponent } from './ngx-circular-player.component';
3 | import { CommonModule } from '@angular/common';
4 |
5 |
6 |
7 | @NgModule({
8 | declarations: [NgxCircularPlayerComponent],
9 | imports: [
10 | CommonModule
11 | ],
12 | exports: [NgxCircularPlayerComponent]
13 | })
14 | export class NgxCircularPlayerModule { }
15 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of ngx-circular-player
3 | */
4 |
5 | export * from './lib/ngx-circular-player.component';
6 | export * from './lib/ngx-circular-player.module';
7 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone';
4 | import 'zone.js/dist/zone-testing';
5 | import { getTestBed } from '@angular/core/testing';
6 | import {
7 | BrowserDynamicTestingModule,
8 | platformBrowserDynamicTesting
9 | } from '@angular/platform-browser-dynamic/testing';
10 |
11 | declare const require: {
12 | context(path: string, deep?: boolean, filter?: RegExp): {
13 | keys(): string[];
14 | (id: string): T;
15 | };
16 | };
17 |
18 | // First, initialize the Angular testing environment.
19 | getTestBed().initTestEnvironment(
20 | BrowserDynamicTestingModule,
21 | platformBrowserDynamicTesting()
22 | );
23 | // Then we find all the tests.
24 | const context = require.context('./', true, /\.spec\.ts$/);
25 | // And load the modules.
26 | context.keys().map(context);
27 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/lib",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": [
10 | "dom",
11 | "es2018"
12 | ]
13 | },
14 | "angularCompilerOptions": {
15 | "skipTemplateCodegen": true,
16 | "strictMetadataEmit": true,
17 | "enableResourceInlining": true
18 | },
19 | "exclude": [
20 | "src/test.ts",
21 | "**/*.spec.ts"
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/projects/ngx-circular-player/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "lib",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "lib",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/server.ts:
--------------------------------------------------------------------------------
1 | import 'zone.js/dist/zone-node';
2 |
3 | import { ngExpressEngine } from '@nguniversal/express-engine';
4 | import * as express from 'express';
5 | import { join } from 'path';
6 |
7 | import { AppServerModule } from './src/main.server';
8 | import { APP_BASE_HREF } from '@angular/common';
9 | import { existsSync } from 'fs';
10 |
11 | // The Express app is exported so that it can be used by serverless Functions.
12 | export function app() {
13 | const server = express();
14 | const distFolder = join(process.cwd(), 'dist/ngx-circular-player-demo/browser');
15 | const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
16 |
17 | // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
18 | server.engine('html', ngExpressEngine({
19 | bootstrap: AppServerModule,
20 | }));
21 |
22 | server.set('view engine', 'html');
23 | server.set('views', distFolder);
24 |
25 | // Example Express Rest API endpoints
26 | // app.get('/api/**', (req, res) => { });
27 | // Serve static files from /browser
28 | server.get('*.*', express.static(distFolder, {
29 | maxAge: '1y'
30 | }));
31 |
32 | // All regular routes use the Universal engine
33 | server.get('*', (req, res) => {
34 | res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
35 | });
36 |
37 | return server;
38 | }
39 |
40 | function run() {
41 | const port = process.env.PORT || 4000;
42 |
43 | // Start up the Node server
44 | const server = app();
45 | server.listen(port, () => {
46 | console.log(`Node Express server listening on http://localhost:${port}`);
47 | });
48 | }
49 |
50 | // Webpack will replace 'require' with '__webpack_require__'
51 | // '__non_webpack_require__' is a proxy to Node 'require'
52 | // The below code is to ensure that the server is run only when not requiring the bundle.
53 | declare const __non_webpack_require__: NodeRequire;
54 | const mainModule = __non_webpack_require__.main;
55 | const moduleFilename = mainModule && mainModule.filename || '';
56 | if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
57 | run();
58 | }
59 |
60 | export * from './src/main.server';
61 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mgechev/ngx-circular-player/6cc308ceb081f1fcb596a60615e3a5ed144f7a26/src/app/app.component.css
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { AppComponent } from './app.component';
3 |
4 | describe('AppComponent', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | declarations: [
8 | AppComponent
9 | ],
10 | }).compileComponents();
11 | }));
12 |
13 | it('should create the app', () => {
14 | const fixture = TestBed.createComponent(AppComponent);
15 | const app = fixture.componentInstance;
16 | expect(app).toBeTruthy();
17 | });
18 |
19 | it(`should have as title 'ngx-circular-player'`, () => {
20 | const fixture = TestBed.createComponent(AppComponent);
21 | const app = fixture.componentInstance;
22 | expect(app.title).toEqual('ngx-circular-player');
23 | });
24 |
25 | it('should render title', () => {
26 | const fixture = TestBed.createComponent(AppComponent);
27 | fixture.detectChanges();
28 | const compiled = fixture.nativeElement;
29 | expect(compiled.querySelector('.content span').textContent).toContain('ngx-circular-player app is running!');
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {}
9 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 |
4 | import { AppComponent } from './app.component';
5 | import { NgxCircularPlayerModule } from 'ngx-circular-player';
6 |
7 | @NgModule({
8 | declarations: [
9 | AppComponent
10 | ],
11 | imports: [
12 | BrowserModule.withServerTransition({ appId: 'serverApp' }),
13 | NgxCircularPlayerModule
14 | ],
15 | providers: [],
16 | bootstrap: [AppComponent]
17 | })
18 | export class AppModule { }
19 |
--------------------------------------------------------------------------------
/src/app/app.server.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule } from '@angular/platform-server';
3 |
4 | import { AppModule } from './app.module';
5 | import { AppComponent } from './app.component';
6 |
7 | @NgModule({
8 | imports: [
9 | AppModule,
10 | ServerModule,
11 | ],
12 | bootstrap: [AppComponent],
13 | })
14 | export class AppServerModule {}
15 |
--------------------------------------------------------------------------------
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mgechev/ngx-circular-player/6cc308ceb081f1fcb596a60615e3a5ed144f7a26/src/assets/.gitkeep
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mgechev/ngx-circular-player/6cc308ceb081f1fcb596a60615e3a5ed144f7a26/src/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Angular Circular Player
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main.server.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 |
3 | import { environment } from './environments/environment';
4 |
5 | if (environment.production) {
6 | enableProdMode();
7 | }
8 |
9 | export { AppServerModule } from './app/app.server.module';
10 | export { renderModule, renderModuleFactory } from '@angular/platform-server';
11 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | document.addEventListener('DOMContentLoaded', () => {
12 | platformBrowserDynamic().bootstrapModule(AppModule)
13 | .catch(err => console.error(err));
14 | });
15 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
22 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
23 |
24 | /**
25 | * Web Animations `@angular/platform-browser/animations`
26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
28 | */
29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
30 |
31 | /**
32 | * By default, zone.js will patch all possible macroTask and DomEvents
33 | * user can disable parts of macroTask/DomEvents patch by setting following flags
34 | * because those flags need to be set before `zone.js` being loaded, and webpack
35 | * will put import in the top of bundle, so user need to create a separate file
36 | * in this directory (for example: zone-flags.ts), and put the following flags
37 | * into that file, and then add the following code before importing zone.js.
38 | * import './zone-flags.ts';
39 | *
40 | * The flags allowed in zone-flags.ts are listed here.
41 | *
42 | * The following flags will work for all browsers.
43 | *
44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47 | *
48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
50 | *
51 | * (window as any).__Zone_enable_cross_context_check = true;
52 | *
53 | */
54 |
55 | /***************************************************************************************************
56 | * Zone JS is required by default for Angular itself.
57 | */
58 | import 'zone.js/dist/zone'; // Included with Angular CLI.
59 |
60 |
61 | /***************************************************************************************************
62 | * APPLICATION IMPORTS
63 | */
64 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | html,
3 | body {
4 | width: 100%;
5 | height: 100%;
6 | padding: 0;
7 | margin: 0;
8 | background-color: black;
9 | }
10 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/app",
5 | "types": []
6 | },
7 | "files": [
8 | "src/main.ts",
9 | "src/polyfills.ts"
10 | ],
11 | "include": [
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "downlevelIteration": true,
9 | "experimentalDecorators": true,
10 | "module": "esnext",
11 | "moduleResolution": "node",
12 | "importHelpers": true,
13 | "target": "es2015",
14 | "typeRoots": [
15 | "node_modules/@types"
16 | ],
17 | "lib": [
18 | "es2018",
19 | "dom"
20 | ],
21 | "paths": {
22 | "ngx-circular-player": [
23 | "projects/ngx-circular-player/src/public-api.ts"
24 | ]
25 | }
26 | },
27 | "angularCompilerOptions": {
28 | "fullTemplateTypeCheck": true,
29 | "strictInjectionParameters": true
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/tsconfig.server.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.app.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/app-server",
5 | "module": "commonjs",
6 | "types": [
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/main.server.ts",
12 | "server.ts"
13 | ],
14 | "angularCompilerOptions": {
15 | "entryModule": "./src/app/app.server.module#AppServerModule"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "src/**/*.spec.ts",
16 | "src/**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:recommended",
3 | "rules": {
4 | "array-type": false,
5 | "arrow-parens": false,
6 | "deprecation": {
7 | "severity": "warning"
8 | },
9 | "component-class-suffix": true,
10 | "contextual-lifecycle": true,
11 | "directive-class-suffix": true,
12 | "directive-selector": [
13 | true,
14 | "attribute",
15 | "app",
16 | "camelCase"
17 | ],
18 | "component-selector": [
19 | true,
20 | "element",
21 | "app",
22 | "kebab-case"
23 | ],
24 | "import-blacklist": [
25 | true,
26 | "rxjs/Rx"
27 | ],
28 | "interface-name": false,
29 | "max-classes-per-file": false,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-consecutive-blank-lines": false,
47 | "no-console": [
48 | true,
49 | "debug",
50 | "info",
51 | "time",
52 | "timeEnd",
53 | "trace"
54 | ],
55 | "no-empty": false,
56 | "no-inferrable-types": [
57 | true,
58 | "ignore-params"
59 | ],
60 | "no-non-null-assertion": true,
61 | "no-redundant-jsdoc": true,
62 | "no-switch-case-fall-through": true,
63 | "no-var-requires": false,
64 | "object-literal-key-quotes": [
65 | true,
66 | "as-needed"
67 | ],
68 | "object-literal-sort-keys": false,
69 | "ordered-imports": false,
70 | "quotemark": [
71 | true,
72 | "single"
73 | ],
74 | "trailing-comma": false,
75 | "no-conflicting-lifecycle": true,
76 | "no-host-metadata-property": true,
77 | "no-input-rename": true,
78 | "no-inputs-metadata-property": true,
79 | "no-output-native": true,
80 | "no-output-on-prefix": true,
81 | "no-output-rename": true,
82 | "no-outputs-metadata-property": true,
83 | "template-banana-in-box": true,
84 | "template-no-negated-async": true,
85 | "use-lifecycle-interface": true,
86 | "use-pipe-transform-interface": true
87 | },
88 | "rulesDirectory": [
89 | "codelyzer"
90 | ]
91 | }
--------------------------------------------------------------------------------