├── src ├── assets │ ├── .gitkeep │ └── header-bg.png ├── app │ ├── app.component.css │ ├── components │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ ├── footer.component.ts │ │ │ └── footer.component.spec.ts │ │ ├── login │ │ │ ├── user2-160x160.jpg │ │ │ ├── login.component.spec.ts │ │ │ ├── login.component.html │ │ │ └── login.component.ts │ │ ├── header │ │ │ ├── header.component.html │ │ │ ├── header.component.ts │ │ │ ├── header.component.css │ │ │ └── header.component.spec.ts │ │ ├── usersinglepost │ │ │ ├── usersinglepost.component.html │ │ │ ├── usersinglepost.component.spec.ts │ │ │ ├── usersinglepost.component.ts │ │ │ └── usersinglepost.component.css │ │ ├── allblogs │ │ │ ├── allblogs.component.spec.ts │ │ │ ├── allblogs.component.html │ │ │ ├── allblogs.component.ts │ │ │ └── allblogs.component.css │ │ ├── register │ │ │ ├── register.component.spec.ts │ │ │ ├── register.component.html │ │ │ └── register.component.ts │ │ ├── dashboard │ │ │ ├── dashboard.component.spec.ts │ │ │ ├── dashboard.component.ts │ │ │ ├── dashboard.component.css │ │ │ └── dashboard.component.html │ │ └── singlepost │ │ │ ├── singlepost.component.spec.ts │ │ │ ├── singlepost.component.html │ │ │ ├── singlepost.component.ts │ │ │ └── singlepost.component.css │ ├── app.component.html │ ├── app.component.ts │ ├── models │ │ └── cosmic.model.ts │ ├── services │ │ ├── auth-guard.service.ts │ │ └── cosmic.service.ts │ ├── app.component.spec.ts │ ├── app-routing.module.ts │ └── app.module.ts ├── favicon.ico ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── config │ ├── cosmic.prod.ts │ └── cosmo.config.ts ├── styles.css ├── tsconfig.app.json ├── tsconfig.spec.json ├── tslint.json ├── browserslist ├── main.ts ├── test.ts ├── karma.conf.js ├── index.html └── polyfills.ts ├── dist └── ngApp │ ├── favicon.ico │ ├── styles.9ab0139598d91d590a2a.css │ ├── assets │ └── header-bg.png │ ├── runtime.a66f828dca56eeb90e02.js │ ├── index.html │ ├── 3rdpartylicenses.txt │ └── polyfills.2f4a59095805af02bd79.js ├── app.json ├── app.js ├── e2e ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts ├── tsconfig.e2e.json └── protractor.conf.js ├── .editorconfig ├── tsconfig.json ├── prepare.js ├── .gitignore ├── README.md ├── tslint.json ├── package.json └── angular.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/angular-blog/master/src/favicon.ico -------------------------------------------------------------------------------- /dist/ngApp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/angular-blog/master/dist/ngApp/favicon.ico -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/angular-blog/master/src/assets/header-bg.png -------------------------------------------------------------------------------- /dist/ngApp/styles.9ab0139598d91d590a2a.css: -------------------------------------------------------------------------------- 1 | .ngx-editor-textarea{height:200px!important;min-height:0!important} -------------------------------------------------------------------------------- /dist/ngApp/assets/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/angular-blog/master/dist/ngApp/assets/header-bg.png -------------------------------------------------------------------------------- /src/app/components/login/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/angular-blog/master/src/app/components/login/user2-160x160.jpg -------------------------------------------------------------------------------- /src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Welcome to Angular Blog

4 |
5 | 6 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "dokku": { 4 | "predeploy": "node prepare.js && ng build --aot --prod" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const app = express() 3 | 4 | app.use(express.static('./dist/ngApp')); 5 | 6 | app.listen(process.env.PORT || 5000, function () { 7 | }); 8 | -------------------------------------------------------------------------------- /src/config/cosmic.prod.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | production: true, 3 | write_key: 'onfOne3PNQ2SH84U7gByZ7McXiRX0LWovzWVpSVWZXqit1lfGu', 4 | bucket_name: 'angular-blog', 5 | 6 | }; -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | .ngx-editor-textarea 4 | { 5 | height: 200px !important; 6 | min-height: 0px !important; 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://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 | -------------------------------------------------------------------------------- /src/config/cosmo.config.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | production: false, 3 | read_key: 'EhuqgAfS5PAkjF2UevYqh2BXJ2ICBZQGodveQwuKEez0RWR7CY', 4 | write_key: 'onfOne3PNQ2SH84U7gByZ7McXiRX0LWovzWVpSVWZXqit1lfGu', 5 | bucket_id: '5bab3c41f69d9e4f0a0408ba', 6 | bucket_slug: 'angular-blog', 7 | URL: 'https://api.cosmicjs.com/v1/', 8 | }; 9 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ngApp!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import 'rxjs/add/operator/catch'; 3 | import 'rxjs/add/operator/map'; 4 | import 'rxjs/add/operator/toPromise'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'] 10 | }) 11 | export class AppComponent { 12 | title = 'app'; 13 | } 14 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .jumbotron { 2 | background: url(/assets/header-bg.png) no-repeat center top; 3 | background-size:cover; 4 | border-radius: 0; 5 | margin-bottom:0; 6 | } 7 | .jumbotron h1 { 8 | font-size: 3.5rem; 9 | font-weight: 300; 10 | line-height: 1.2; 11 | color: #fff; 12 | font-weight: bold; 13 | } 14 | .cntr{text-align: center} -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-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 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/app/models/cosmic.model.ts: -------------------------------------------------------------------------------- 1 | export class registerModel { 2 | 3 | _id: string; 4 | username: string; 5 | email: string; 6 | password: string; 7 | fullName: string; 8 | imageUrl: string; 9 | 10 | } 11 | 12 | export class blogModel { 13 | 14 | _id: string; 15 | title: string; 16 | content: string; 17 | author: string; 18 | description: string; 19 | blogImage: string; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /prepare.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | var str = ` 4 | export const config = { 5 | production: true, 6 | read_key: '${process.env.COSMIC_READ_KEY}', 7 | write_key: '${process.env.COSMIC_WRITE_KEY}', 8 | bucket_name: '${process.env.COSMIC_BUCKET}', 9 | 10 | }; 11 | `; 12 | fs.writeFile("./src/config/cosmic.prod.ts", str, function(err) { 13 | if(err) { 14 | return console.log(err); 15 | } 16 | console.log("The file was saved!"); 17 | }); 18 | -------------------------------------------------------------------------------- /src/app/components/usersinglepost/usersinglepost.component.html: -------------------------------------------------------------------------------- 1 | Back 2 |
3 | 4 |
5 | 6 | 18 |
19 | 20 |
-------------------------------------------------------------------------------- /.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | /* 11 | * In development mode, to ignore zone related error stack frames such as 12 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 13 | * import the following file, but please comment it out in production mode 14 | * because it will have performance impact when throw error 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/app/components/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/allblogs/allblogs.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AllblogsComponent } from './allblogs.component'; 4 | 5 | describe('AllblogsComponent', () => { 6 | let component: AllblogsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AllblogsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AllblogsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/register/register.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegisterComponent } from './register.component'; 4 | 5 | describe('RegisterComponent', () => { 6 | let component: RegisterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ RegisterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RegisterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/dashboard/dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | describe('DashboardComponent', () => { 6 | let component: DashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/singlepost/singlepost.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SinglepostComponent } from './singlepost.component'; 4 | 5 | describe('SinglepostComponent', () => { 6 | let component: SinglepostComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SinglepostComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SinglepostComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/usersinglepost/usersinglepost.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UsersinglepostComponent } from './usersinglepost.component'; 4 | 5 | describe('UsersinglepostComponent', () => { 6 | let component: UsersinglepostComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ UsersinglepostComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(UsersinglepostComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/allblogs/allblogs.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /src/app/services/auth-guard.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | import { BehaviorSubject } from 'rxjs/BehaviorSubject'; 6 | 7 | @Injectable() 8 | export class AuthGuard implements CanActivate { 9 | x; 10 | constructor( 11 | private router: Router, 12 | ) {} 13 | 14 | canActivate( 15 | route: ActivatedRouteSnapshot, 16 | state: RouterStateSnapshot 17 | ): Observable { 18 | const url = state.url; 19 | const params = route.queryParams; 20 | var jsondata = JSON.parse(localStorage.getItem('user')); 21 | if (jsondata == null) { 22 | 23 | this.router.navigate(['login']); 24 | return new BehaviorSubject(false); 25 | } else { 26 | 27 | return new BehaviorSubject(true); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dist/ngApp/runtime.a66f828dca56eeb90e02.js: -------------------------------------------------------------------------------- 1 | !function(r){function e(e){for(var t,p,c=e[0],a=e[1],f=e[2],l=0,s=[];l { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ngApp!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/components/allblogs/allblogs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Router } from '@angular/router'; 4 | import { CosmicService } from '../../services/cosmic.service' 5 | 6 | @Component({ 7 | selector: 'app-allblogs', 8 | templateUrl: './allblogs.component.html', 9 | styleUrls: ['./allblogs.component.css'] 10 | }) 11 | export class AllblogsComponent implements OnInit { 12 | data; 13 | allBlogs; 14 | allPosts; 15 | author; 16 | jdata; 17 | constructor(private _http: Http, private route: Router, private cosmicService: CosmicService) { } 18 | 19 | //fetching all blogs from server 20 | showAllBlogs() { 21 | this.cosmicService.showAllBlogs() 22 | .subscribe(res => { 23 | this.data = res; 24 | var jsondata = JSON.parse(this.data._body); 25 | this.allBlogs = jsondata.objects; 26 | console.log(this.allBlogs); 27 | }) 28 | } 29 | 30 | loginCall() { 31 | this.route.navigate(['login']); 32 | } 33 | 34 | ngOnInit() { 35 | 36 | this.showAllBlogs() 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Angular App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/app/components/singlepost/singlepost.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Back 4 |
5 | 6 |
7 | 8 |
    9 |
    10 | 11 |
    12 |

    {{data.title}}

    13 |

    Author: {{data.metadata.author}}

    14 | 15 |
    16 |
    17 |
    18 |
19 | 20 |
21 |
22 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/app/components/usersinglepost/usersinglepost.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Component, OnInit } from '@angular/core'; 3 | import { ActivatedRoute, Router } from '@angular/router'; 4 | import { Http } from '@angular/http'; 5 | import { CosmicService } from '../../services/cosmic.service' 6 | 7 | 8 | @Component({ 9 | selector: 'app-usersinglepost', 10 | templateUrl: './usersinglepost.component.html', 11 | styleUrls: ['./usersinglepost.component.css'] 12 | }) 13 | export class UsersinglepostComponent implements OnInit { 14 | data; 15 | allPosts; 16 | singlePost: any; 17 | constructor(private router: ActivatedRoute, private route: Router, private _http: Http, private cosmicService: CosmicService) { } 18 | 19 | ngOnInit() { 20 | 21 | this.data = this.router.snapshot.queryParamMap; 22 | this.post(); 23 | } 24 | 25 | /** to show single post */ 26 | post() { 27 | var data = this.data.params.post_id; 28 | this.cosmicService.singlePostHome() 29 | 30 | .subscribe(res => { 31 | this.data = res; 32 | var jsondata = JSON.parse(this.data._body); 33 | this.allPosts = jsondata.objects; 34 | 35 | this.singlePost = this.allPosts.filter( 36 | post => post._id === data); 37 | var da = this.singlePost[0]; 38 | console.log(da) 39 | }) 40 | } 41 | 42 | dashboardCall() 43 | { 44 | this.route.navigate(['dashboard']) 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular Blog 2 | 3 | ![Screenshot](https://cosmic-s3.imgix.net/40ab22a0-c718-11e8-8e06-0bd0f42fa67f-angular-blog.png?w=1200) 4 | 5 | ### [View Demo](https://cosmicjs.com/apps/angular-blog) 6 | #### [Read how it was built](https://cosmicjs.com/articles/how-to-build-a-blog-using-angular-and-cosmic-js) 7 | 8 | This project was generated with Angular CLI and [Cosmic JS](https://cosmicjs.com/). 9 | 10 | # Get Started 11 | 12 | ## Running server: 13 | 14 | ``` 15 | git clone https://github.com/cosmicjs/angular-blog 16 | cd angular-blog 17 | npm install 18 | COSMIC_BUCKET=your-bucket-slug COSMIC_READ_KEY=your-read-key COSMIC_WRITE_KEY=your-write-key npm start 19 | ``` 20 | 21 | Then navigate to: http://localhost:4200/ 22 | 23 | ## Development server 24 | 25 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. --> 26 | 27 | ## Build 28 | 29 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 30 | 31 | ## Running unit tests 32 | 33 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 34 | 35 | ## Running end-to-end tests 36 | 37 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 38 | 39 | ## Further help 40 | 41 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 42 | 43 | 44 | -------------------------------------------------------------------------------- /dist/ngApp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Angular App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, Component } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { AllblogsComponent } from './components/allblogs/allblogs.component'; 4 | import { SinglepostComponent } from './components/singlepost/singlepost.component'; 5 | import { UsersinglepostComponent } from './components/usersinglepost/usersinglepost.component'; 6 | import { RegisterComponent } from './components/register/register.component'; 7 | import { LoginComponent } from './components/login/login.component'; 8 | import { DashboardComponent } from './components/dashboard/dashboard.component'; 9 | import { AuthGuard } from './services/auth-guard.service'; 10 | 11 | 12 | const appRoutes: Routes = [ 13 | { 14 | path: 'login', 15 | component: LoginComponent 16 | }, 17 | { 18 | path: 'register', 19 | component: RegisterComponent 20 | }, 21 | { 22 | path: '', 23 | component: AllblogsComponent 24 | }, 25 | 26 | { path: 'dashboard', component: DashboardComponent, pathMatch: 'full', canActivate: [AuthGuard] }, 27 | { 28 | path: 'singlepost', 29 | component: SinglepostComponent 30 | }, 31 | { 32 | path: 'singlepost', 33 | component: SinglepostComponent 34 | }, 35 | { 36 | path: 'dashboard/usersinglepost', 37 | component: UsersinglepostComponent 38 | }, 39 | 40 | ] 41 | 42 | @NgModule({ 43 | imports: [ 44 | // RouterModule.forRoot(appRoutes, { useHash: true }), 45 | RouterModule.forRoot(appRoutes) 46 | ], 47 | exports: [RouterModule] 48 | }) 49 | export class AppRoutingModule { 50 | 51 | } -------------------------------------------------------------------------------- /src/app/components/login/login.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Log in 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/app/components/usersinglepost/usersinglepost.component.css: -------------------------------------------------------------------------------- 1 | .cntr{text-align: center} 2 | ul { 3 | list-style: none; 4 | } 5 | .jumbotron { 6 | background: url(/assets/header-bg.png) no-repeat center top; 7 | background-size:cover; 8 | border-radius: 0; 9 | margin-bottom: 1rem; 10 | } 11 | 12 | 13 | .jumbotron h1 { 14 | font-size: 3.5rem; 15 | font-weight: 300; 16 | line-height: 1.2; 17 | color: #fff; 18 | font-weight: bold; 19 | 20 | } 21 | .navbar-nav li { 22 | margin-right: 11px; 23 | } 24 | .navbar-nav li .btn { 25 | background:#f2f2f2; 26 | border-radius: 0; 27 | border-bottom: 2px solid #f2f2f2; 28 | } 29 | .navbar-nav li.active .btn { 30 | background: #3c8dbc; 31 | border-bottom: 2px solid #3c8dbc; 32 | color: #fff; 33 | } 34 | .blog { 35 | width:100%; 36 | float: left; 37 | margin: 30px 0; 38 | } 39 | .blog ul { 40 | width:100%; 41 | display: block; 42 | margin: 0; 43 | float: left; 44 | padding: 0; 45 | } 46 | .blog .blog-image { 47 | float: left; 48 | margin-right: 25px; 49 | border: 8px solid #f2f2f2; 50 | } 51 | .blog h3 { 52 | font-weight: 500; 53 | margin-bottom: 15px; 54 | } 55 | .blog .btn-success { 56 | border-radius: 0; 57 | background: #3c8dbc; 58 | border: 2px solid #3c8dbc; 59 | color: #fff; 60 | transition:all 0.5s; 61 | } 62 | .blog .btn-success:hover { 63 | background:none; 64 | border: 2px solid #3c8dbc; 65 | color: #3c8dbc; 66 | } 67 | 68 | .left{float:left; margin-right: 15px;} 69 | .pointer {cursor: pointer} 70 | .back-btn { 71 | background: #3c8dbc; 72 | padding: 6px 20px; 73 | color:#fff !important; 74 | margin: 10px; 75 | } 76 | 77 | 78 | /* Responsive start here */ 79 | 80 | @media (max-width:767px) { 81 | .blog .blog-image { 82 | float: none; 83 | margin-bottom: 20px; 84 | text-align: center; 85 | display: block; 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /src/app/components/allblogs/allblogs.component.css: -------------------------------------------------------------------------------- 1 | .cntr{text-align: center} 2 | ul { 3 | list-style: none; 4 | } 5 | .jumbotron { 6 | /* background: url(/assets/header-bg.png) no-repeat center top; */ 7 | background-size:cover; 8 | border-radius: 0; 9 | margin-bottom: 1rem; 10 | } 11 | 12 | 13 | .jumbotron h1 { 14 | font-size: 3.5rem; 15 | font-weight: 300; 16 | line-height: 1.2; 17 | color: #fff; 18 | font-weight: bold; 19 | 20 | } 21 | .navbar-nav li { 22 | margin-right: 11px; 23 | } 24 | .navbar-nav li .btn { 25 | background:#f2f2f2; 26 | border-radius: 0; 27 | border-bottom: 2px solid #f2f2f2; 28 | } 29 | .navbar-nav li.active .btn { 30 | background: #3c8dbc; 31 | border-bottom: 2px solid #3c8dbc; 32 | color: #fff; 33 | } 34 | .blog { 35 | width:100%; 36 | float: left; 37 | margin: 30px 0; 38 | } 39 | .blog ul { 40 | width:100%; 41 | display: block; 42 | margin: 0 0 30px; 43 | float: left; 44 | padding: 0; 45 | } 46 | .blog .blog-image { 47 | float: left; 48 | margin-right: 25px; 49 | border: 8px solid #f2f2f2; 50 | padding:20px; 51 | } 52 | .blog .blog-image img { 53 | max-width: 100%; 54 | height: auto; 55 | } 56 | .blog h3 { 57 | font-weight: 500; 58 | margin-bottom: 15px; 59 | } 60 | .blog .btn-success { 61 | border-radius: 0; 62 | background: #3c8dbc; 63 | border: 2px solid #3c8dbc; 64 | color: #fff; 65 | transition:all 0.5s; 66 | } 67 | .blog .btn-success:hover { 68 | background:none; 69 | border: 2px solid #3c8dbc; 70 | color: #3c8dbc; 71 | } 72 | 73 | .right{float:right; margin-right: 15px; color: #3c8dbc;} 74 | 75 | .pointer {cursor: pointer} 76 | .login-btn { 77 | position: absolute; 78 | top: 14px; 79 | right: 0; 80 | background: #fff; 81 | padding: 6px 20px; 82 | } 83 | 84 | a { text-decoration: none; color: rgb(39, 37, 37)} 85 | 86 | /* Responsive start here */ 87 | 88 | @media (max-width:767px) { 89 | .blog .blog-image { 90 | float: none; 91 | margin-bottom: 20px; 92 | text-align: center; 93 | display: block; 94 | } 95 | } -------------------------------------------------------------------------------- /src/app/components/register/register.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Registration Page 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 22 | 23 |
24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 | 37 |
38 | 39 |
40 |
41 | 42 |
43 | 44 | 45 |

{{message}}

46 |
47 | 50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/app/components/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Http, Headers, RequestOptions } from '@angular/http'; 3 | import { Router } from '@angular/router'; 4 | import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; 5 | import { CosmicService } from '../../services/cosmic.service' 6 | import {config} from '../../../config/cosmo.config' 7 | 8 | @Component({ 9 | selector: 'app-login', 10 | templateUrl: './login.component.html', 11 | styleUrls: ['./login.component.css'] 12 | }) 13 | export class LoginComponent implements OnInit { 14 | 15 | loginForm: FormGroup; 16 | message = ""; 17 | data; 18 | 19 | constructor(private _http: Http, private fb: FormBuilder, private router: Router, private cosmicService: CosmicService) { 20 | 21 | this.loginForm = this.fb.group({ 22 | 'username': ['', Validators.required], 23 | 'password': ['', Validators.required], 24 | 25 | }); 26 | 27 | } 28 | /** logging user in */ 29 | login() { 30 | const credentials = this.loginForm.value; 31 | 32 | credentials.read_key = config.read_key 33 | this.cosmicService.login(credentials) 34 | 35 | .subscribe(res => { 36 | this.data = res; 37 | var jsondata = JSON.parse(this.data._body); 38 | if (jsondata.message == "No objects returned.") { 39 | return this.message = "username or password is wrong"; 40 | } 41 | console.log(this.data._body); 42 | const userPassword = jsondata.objects[0].metadata.password; 43 | if (userPassword == credentials.password) { 44 | console.log('login Success'); 45 | localStorage.setItem('user', JSON.stringify({ jsondata })); 46 | this.router.navigate(["dashboard"]); 47 | } 48 | else { 49 | this.message = "Username or password is wrong"; 50 | console.log('Login Failed'); 51 | } 52 | }) 53 | 54 | } 55 | 56 | /** navigate to register page */ 57 | registerCall() { 58 | this.router.navigate(["register"]); 59 | } 60 | 61 | ngOnInit() { 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/app/components/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Router } from '@angular/router'; 4 | import { CosmicService } from '../../services/cosmic.service' 5 | import {config} from '../../../config/cosmo.config' 6 | 7 | import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; 8 | @Component({ 9 | selector: 'app-register', 10 | templateUrl: './register.component.html', 11 | styleUrls: ['./register.component.css'] 12 | }) 13 | export class RegisterComponent implements OnInit { 14 | 15 | registerForm: FormGroup; 16 | message = ""; 17 | data; 18 | img; 19 | 20 | constructor(private _http: Http, private fb: FormBuilder, private router: Router, private cosmicService: CosmicService,) { 21 | this.registerForm = this.fb.group({ 22 | 'username': ['', Validators.required], 23 | 'email': ['', Validators.required], 24 | 'fullName': ['', Validators.required], 25 | 'password': ['', Validators.required], 26 | 'imageUrl': ['', Validators.required], 27 | 28 | }); 29 | } 30 | 31 | imagesave(e: Event) { 32 | const target: HTMLInputElement = e.target as HTMLInputElement; 33 | let file = target.files[0]; 34 | this.img = file; 35 | console.log(this.img); 36 | } 37 | 38 | //registering the user 39 | register() { 40 | const credentials = this.registerForm.value; 41 | console.log(credentials.image); 42 | credentials.write_key = config.write_key; 43 | credentials.read_key = config.read_key; 44 | 45 | this.cosmicService.getUser(credentials) 46 | .subscribe(res => { 47 | this.data = res; 48 | var jsondata = JSON.parse(this.data._body); 49 | if (jsondata.message == "No objects returned.") { 50 | this.cosmicService.addUser(credentials) 51 | .subscribe(res => { 52 | console.log(res); 53 | if (res) { 54 | this.router.navigate(['login']); 55 | } 56 | }) 57 | } 58 | else { 59 | return this.message = "Username already exists"; 60 | 61 | } 62 | }) 63 | } 64 | 65 | loginCall() { 66 | this.router.navigate(['login']); 67 | } 68 | 69 | ngOnInit() { 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/app/components/singlepost/singlepost.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Router } from '@angular/router'; 3 | import { Http } from '@angular/http'; 4 | import {blogModel} from '../../models/cosmic.model'; 5 | import { CosmicService } from '../../services/cosmic.service'; 6 | import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; 7 | 8 | @Component({ 9 | selector: 'app-singlepost', 10 | templateUrl: './singlepost.component.html', 11 | styleUrls: ['./singlepost.component.css'] 12 | }) 13 | export class SinglepostComponent implements OnInit { 14 | data: any; 15 | allPosts: any; 16 | singlePost: any; 17 | blogModel = new blogModel(); 18 | slug: any; 19 | commentForm: FormGroup; 20 | message; 21 | constructor(private router: ActivatedRoute, private route: Router, private _http: Http, private cosmicService: CosmicService,private fb: FormBuilder) 22 | { 23 | this.commentForm = this.fb.group({ 24 | 'name': ['', Validators.required], 25 | 'comment': ['', Validators.required], 26 | 27 | }); 28 | } 29 | 30 | ngOnInit() { 31 | 32 | this.data = this.router.snapshot.queryParamMap; 33 | this.post(); 34 | } 35 | 36 | /** to show single blog */ 37 | post() { 38 | var data = this.data.params.slug; 39 | 40 | this.cosmicService.showSinglePostDashboard() 41 | 42 | .subscribe(res => { 43 | this.data = res; 44 | var jsondata = JSON.parse(this.data._body); 45 | this.allPosts = jsondata.objects; 46 | 47 | this.singlePost = this.allPosts.filter( 48 | post => post.slug === data); 49 | var da = this.singlePost[0]; 50 | console.log(da) 51 | }) 52 | 53 | } 54 | 55 | /** add comment*/ 56 | 57 | // comment() 58 | // { 59 | // const data = this.commentForm.value; 60 | // var jdata = JSON.parse(this.data._body); 61 | // this.slug = jdata.objects[0].slug; 62 | // data.slug = this.slug; 63 | // this.cosmicService.saveComment(data) 64 | // .subscribe(res => { 65 | // console.log(res); 66 | // this.message = "Comment Added"; 67 | // }) 68 | // } 69 | 70 | /** navigate to login page*/ 71 | loginCall() { 72 | this.route.navigate(['login']); 73 | } 74 | 75 | /** navigate to dashboard */ 76 | 77 | dashboardCall() 78 | { 79 | this.route.navigate(['']); 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/app/components/singlepost/singlepost.component.css: -------------------------------------------------------------------------------- 1 | .cntr{text-align: center} 2 | ul { 3 | list-style: none; 4 | } 5 | .jumbotron { 6 | background: url(/assets/header-bg.png) no-repeat center top; 7 | background-size:cover; 8 | border-radius: 0; 9 | margin-bottom: 1rem; 10 | } 11 | 12 | 13 | .jumbotron h1 { 14 | font-size: 3.5rem; 15 | font-weight: 300; 16 | line-height: 1.2; 17 | color: #fff; 18 | font-weight: bold; 19 | 20 | } 21 | .navbar-nav li { 22 | margin-right: 11px; 23 | } 24 | .navbar-nav li .btn { 25 | background:#f2f2f2; 26 | border-radius: 0; 27 | border-bottom: 2px solid #f2f2f2; 28 | } 29 | .navbar-nav li.active .btn { 30 | background: #3c8dbc; 31 | border-bottom: 2px solid #3c8dbc; 32 | color: #fff; 33 | } 34 | .blog { 35 | width:100%; 36 | float: left; 37 | margin: 30px 0; 38 | } 39 | .blog ul { 40 | width:100%; 41 | display: block; 42 | margin: 0; 43 | float: left; 44 | padding: 0; 45 | } 46 | .blog .blog-image { 47 | float: left; 48 | margin-right: 25px; 49 | border: 8px solid #f2f2f2; 50 | } 51 | .blog h3 { 52 | font-weight: 500; 53 | margin-bottom: 15px; 54 | } 55 | .blog .btn-success { 56 | border-radius: 0; 57 | background: #3c8dbc; 58 | border: 2px solid #3c8dbc; 59 | color: #fff; 60 | transition:all 0.5s; 61 | } 62 | .blog .btn-success:hover { 63 | background:none; 64 | border: 2px solid #3c8dbc; 65 | color: #3c8dbc; 66 | } 67 | 68 | .right{float:right; margin-right: 15px; color: #3c8dbc;} 69 | .left{float:left; margin-right: 15px;} 70 | 71 | .pointer {cursor: pointer} 72 | .back-btn { 73 | background: #3c8dbc; 74 | padding: 6px 20px; 75 | color:#fff !important; 76 | margin: 10px; 77 | } 78 | .login-btn { 79 | position: absolute; 80 | top: 14px; 81 | right: 0; 82 | background: #fff; 83 | padding: 6px 20px; 84 | } 85 | 86 | .p-t-50 { 87 | padding-top: 50px;} 88 | .form-back 89 | { 90 | background-color: #ddd; 91 | padding: 20px; 92 | box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.48); 93 | } 94 | .blog { 95 | width:100%; 96 | float: left; 97 | margin: 30px 0; 98 | } 99 | .textarea-comment { 100 | height: 120px; 101 | } 102 | .btn-comment { 103 | border: none; 104 | border-radius: 0; 105 | background: #3c8dbc; 106 | } 107 | 108 | /* Responsive start here */ 109 | 110 | @media (max-width:767px) { 111 | .blog .blog-image { 112 | float: none; 113 | margin-bottom: 20px; 114 | text-align: center; 115 | display: block; 116 | } 117 | } 118 | 119 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, enableProdMode } from '@angular/core'; 3 | import { RouterModule } from '@angular/router'; 4 | import { HttpModule } from '@angular/http'; 5 | import { AuthGuard } from './services/auth-guard.service'; 6 | import { FormsModule } from '@angular/forms'; 7 | import { AppComponent } from './app.component'; 8 | import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; 9 | import { TooltipModule } from 'ngx-bootstrap/tooltip'; 10 | import { ModalModule } from 'ngx-bootstrap/modal'; 11 | import { DropdownModule } from "ngx-dropdown"; 12 | import { ReactiveFormsModule } from '@angular/forms'; 13 | import { HttpClient, HttpHandler } from '@angular/common/http'; 14 | import { HttpClientModule } from '@angular/common/http'; 15 | import { AppRoutingModule } from './app-routing.module'; 16 | import { HeaderComponent } from './components/header/header.component'; 17 | import { FooterComponent } from './components/footer/footer.component'; 18 | import { AllblogsComponent } from './components/allblogs/allblogs.component'; 19 | import { SinglepostComponent } from './components/singlepost/singlepost.component'; 20 | import { UsersinglepostComponent } from './components/usersinglepost/usersinglepost.component'; 21 | import { RegisterComponent } from './components/register/register.component'; 22 | import { LoginComponent } from './components/login/login.component'; 23 | import { DashboardComponent } from './components/dashboard/dashboard.component'; 24 | import { CosmicService} from './services/cosmic.service' 25 | import { NgxEditorModule } from 'ngx-editor'; 26 | import { AngularFontAwesomeModule } from 'angular-font-awesome'; 27 | enableProdMode(); 28 | 29 | @NgModule({ 30 | declarations: [ 31 | AppComponent, 32 | HeaderComponent, 33 | FooterComponent, 34 | AllblogsComponent, 35 | SinglepostComponent, 36 | UsersinglepostComponent, 37 | RegisterComponent, 38 | LoginComponent, 39 | DashboardComponent, 40 | 41 | ], 42 | imports: [ 43 | BrowserModule, 44 | FormsModule, 45 | HttpModule, 46 | BsDropdownModule.forRoot(), 47 | TooltipModule.forRoot(), 48 | ModalModule.forRoot(), 49 | DropdownModule, 50 | ReactiveFormsModule, 51 | HttpClientModule, 52 | AppRoutingModule, 53 | RouterModule.forRoot([ 54 | ]), 55 | NgxEditorModule, 56 | AngularFontAwesomeModule, 57 | ], 58 | exports: [BsDropdownModule, TooltipModule, ModalModule], 59 | providers: [HttpClient, AuthGuard, CosmicService], 60 | bootstrap: [AppComponent] 61 | }) 62 | export class AppModule { 63 | 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /src/app/components/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Output, EventEmitter } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { Http } from '@angular/http'; 4 | import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; 5 | import { CosmicService } from '../../services/cosmic.service'; 6 | import {config} from '../../../config/cosmo.config' 7 | import {blogModel} from '../../models/cosmic.model' 8 | 9 | @Component({ 10 | selector: 'app-dashboard', 11 | templateUrl: './dashboard.component.html', 12 | styleUrls: ['./dashboard.component.css'] 13 | }) 14 | export class DashboardComponent implements OnInit { 15 | data; 16 | allBlogs; 17 | allPosts; 18 | blogForm: FormGroup; 19 | count = false; 20 | show = false; 21 | message; 22 | menu : boolean = false; 23 | constructor(private router: Router, private _http: Http, private fb: FormBuilder,private cosmicService: CosmicService, 24 | 25 | ) { 26 | this.blogForm = this.fb.group({ 27 | 'title': ['', [Validators.required]], 28 | 'description': ['', [Validators.required]], 29 | 'content': ['', Validators.required], 30 | 'blogImage': ['', [Validators.required]], 31 | }); 32 | } 33 | 34 | //to add new blog 35 | addNewBlog() { 36 | this.show = false; 37 | this.count = true; 38 | } 39 | toggleMenu() 40 | { 41 | this.menu = !this.menu; 42 | } 43 | //getting all blogs' data 44 | 45 | viewAllBlogs() { 46 | this.count = false; 47 | this.show = true; 48 | this.cosmicService.showAllBlogs() 49 | 50 | .subscribe(res => { 51 | 52 | this.data = res; 53 | var jsondata = JSON.parse(this.data._body); 54 | this.allBlogs = jsondata.objects; 55 | }) 56 | } 57 | //view Blogs of logged in user 58 | viewBlogs() { 59 | this.count = false; 60 | this.show = true; 61 | 62 | this.cosmicService.showBlogs() 63 | 64 | .subscribe(res => { 65 | this.data = res; 66 | var jsondata = JSON.parse(this.data._body); 67 | this.allBlogs = jsondata.objects; 68 | 69 | }) 70 | } 71 | //logging user out 72 | logout() { 73 | localStorage.removeItem('user'); 74 | this.router.navigate(['']); 75 | } 76 | 77 | submitForm() { 78 | 79 | const data = this.blogForm.value; 80 | 81 | this.cosmicService.addBlog(data) 82 | 83 | .subscribe(res => { 84 | console.log(res); 85 | this.message = "Blog added successfully"; 86 | }) 87 | } 88 | 89 | // hitId() 90 | // { 91 | // this.cosmicService.hitId() 92 | 93 | // .subscribe(res => { 94 | // console.log(res); 95 | 96 | // }) 97 | // } 98 | 99 | ngOnInit() { 100 | 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 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-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /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/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /src/app/components/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- 1 | .cntr{text-align: center} 2 | .bg{background: white} 3 | 4 | ul { 5 | list-style: none; 6 | } 7 | .jumbotron { 8 | background: url(/assets/header-bg.png) no-repeat center top; 9 | background-size:cover; 10 | border-radius: 0; 11 | margin-bottom: 1rem; 12 | } 13 | 14 | 15 | .jumbotron h1 { 16 | font-size: 3.5rem; 17 | font-weight: 300; 18 | line-height: 1.2; 19 | color: #fff; 20 | font-weight: bold; 21 | 22 | } 23 | .navbar-nav li { 24 | margin-right: 11px; 25 | } 26 | .navbar-nav li .btn { 27 | background:#f2f2f2; 28 | border-radius: 0; 29 | border-bottom: 2px solid #f2f2f2; 30 | } 31 | .navbar-nav li.active .btn { 32 | background: #3c8dbc; 33 | border-bottom: 2px solid #3c8dbc; 34 | color: #fff; 35 | } 36 | .blog { 37 | width:100%; 38 | float: left; 39 | margin: 30px 0; 40 | } 41 | .blog ul { 42 | width:100%; 43 | display: block; 44 | margin: 0; 45 | float: left; 46 | padding: 0; 47 | } 48 | .blog .blog-image { 49 | float: left; 50 | margin-right: 25px; 51 | border: 8px solid #f2f2f2; 52 | } 53 | .blog h3 { 54 | font-weight: 500; 55 | margin-bottom: 15px; 56 | } 57 | .blog .btn-success { 58 | border-radius: 0; 59 | background: #3c8dbc; 60 | border: 2px solid #3c8dbc; 61 | color: #fff; 62 | transition:all 0.5s; 63 | } 64 | .blog .btn-success:hover { 65 | background:none; 66 | border: 2px solid #3c8dbc; 67 | color: #3c8dbc; 68 | } 69 | 70 | /* second */ 71 | 72 | div{align-content:center} 73 | 74 | 75 | .form-back 76 | { 77 | background-color: #ddd; 78 | padding: 20px; 79 | box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.48); 80 | } 81 | .p-t-50 { 82 | padding-top: 50px; 83 | } 84 | .upload-padd 85 | { 86 | padding-top: 3px; 87 | padding-bottom: 3px; 88 | padding-left: 10px; 89 | } 90 | .mobile-tabs { 91 | display:none; 92 | } 93 | .nav-icon { 94 | display:none; 95 | } 96 | /* Responsive start here */ 97 | 98 | @media (max-width:767px) { 99 | .blog .blog-image { 100 | float: none; 101 | margin-bottom: 20px; 102 | text-align: center; 103 | display: block; 104 | 105 | } 106 | .display-none { 107 | display:none; 108 | } 109 | .mobile-tabs { 110 | display:block; 111 | width: 100%; 112 | margin-top: 15px; 113 | } 114 | .nav-icon { 115 | display:block; 116 | width: 100%; 117 | } 118 | .nav-icon .fa-bars { 119 | float: right; 120 | font-size: 18px; 121 | background: #2c8dc7; 122 | padding: 7px 10px; 123 | border-radius: 4px; 124 | color: #fff; 125 | } 126 | .mobile-tabs ul { 127 | padding: 0; 128 | margin: 0; 129 | list-style: none; 130 | } 131 | .mobile-tabs li { 132 | margin-right: 11px; 133 | text-align: right; 134 | } 135 | .mobile-tabs li .btn { 136 | background:#f2f2f2; 137 | border-radius: 0; 138 | border-bottom: 2px solid #f2f2f2; 139 | } 140 | .mobile-tabs li .btn { 141 | background: #3c8dbc; 142 | border-bottom: 2px solid #3c8dbc; 143 | color: #fff; 144 | margin-bottom:10px; 145 | max-width: 182px; 146 | width: 100%; 147 | } 148 | } 149 | 150 | 151 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-app", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "build": "ng build", 7 | "test": "ng test", 8 | "lint": "ng lint", 9 | "e2e": "ng e2e", 10 | "start": "node app.js" 11 | }, 12 | "engines": { 13 | "node": "8.12.0", 14 | "npm": "6.4.1" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular-devkit/build-angular": "~0.6.8", 19 | "@angular/animations": "^6.0.3", 20 | "@angular/cli": "^6.2.2", 21 | "@angular/common": "^6.0.3", 22 | "@angular/compiler": "^6.0.3", 23 | "@angular/compiler-cli": "^6.0.3", 24 | "@angular/core": "^6.0.3", 25 | "@angular/flex-layout": "^2.0.0-rc.1", 26 | "@angular/forms": "^6.0.3", 27 | "@angular/http": "^6.0.3", 28 | "@angular/language-service": "^6.0.3", 29 | "@angular/platform-browser": "^6.0.3", 30 | "@angular/platform-browser-dynamic": "^6.0.3", 31 | "@angular/router": "^6.0.3", 32 | "@types/jasmine": "~2.8.6", 33 | "@types/jasminewd2": "~2.0.3", 34 | "@types/jquery": "^3.3.5", 35 | "@types/node": "~8.9.4", 36 | "angular-font-awesome": "^3.1.2", 37 | "angular-http-interceptor": "^2.0.1", 38 | "angular-in-memory-web-api": "^0.6.1", 39 | "angular2-cool-http": "^4.0.4", 40 | "angular2-datatable": "^0.6.0", 41 | "bootstrap": "^4.1.3", 42 | "codelyzer": "~4.2.1", 43 | "core-js": "^2.5.4", 44 | "cors": "^2.8.4", 45 | "cosmicjs": "^3.2.12", 46 | "express": "^4.16.3", 47 | "express-jwt": "^5.3.1", 48 | "font-awesome": "^4.7.0", 49 | "interceptor.js": "^0.2.0", 50 | "jasmine-core": "~2.99.1", 51 | "jasmine-spec-reporter": "~4.2.1", 52 | "jquery": "^3.3.1", 53 | "karma": "^2.0.5", 54 | "karma-chrome-launcher": "~2.2.0", 55 | "karma-coverage-istanbul-reporter": "~2.0.0", 56 | "karma-jasmine": "~1.1.1", 57 | "karma-jasmine-html-reporter": "^0.2.2", 58 | "ng-http-interceptor": "^4.0.0", 59 | "ng2-comment": "0.0.9", 60 | "ng2-interceptors": "^1.3.0-1", 61 | "ng2-order-pipe": "^0.1.5", 62 | "ng2-search-filter": "^0.4.7", 63 | "ngx-bootstrap": "^3.0.1", 64 | "ngx-dropdown": "0.0.22", 65 | "ngx-editor": "^3.3.0", 66 | "ngx-paginate": "^1.0.5", 67 | "ngx-pagination": "^3.1.1", 68 | "ngx-pagination-bootstrap": "^1.6.0", 69 | "ngx-spinner": "^6.0.0", 70 | "ngx-treeview": "^6.0.0", 71 | "ngx-typeahead": "^6.0.2", 72 | "npm": "^6.4.1", 73 | "protractor": "^5.4.0", 74 | "rxjs": "^6.0.0", 75 | "rxjs-compat": "^6.2.2", 76 | "ts-node": "~5.0.1", 77 | "tslint": "~5.9.1", 78 | "typescript": "~2.7.2", 79 | "zone.js": "^0.8.26" 80 | }, 81 | "devDependencies": { 82 | "@angular-devkit/build-angular": "~0.6.8", 83 | "@angular/cli": "^6.2.2", 84 | "@angular/compiler-cli": "^6.0.3", 85 | "@angular/language-service": "^6.0.3", 86 | "@types/jasmine": "~2.8.6", 87 | "@types/jasminewd2": "~2.0.3", 88 | "@types/node": "~8.9.4", 89 | "codelyzer": "~4.2.1", 90 | "jasmine-core": "~2.99.1", 91 | "jasmine-spec-reporter": "~4.2.1", 92 | "karma": "^2.0.5", 93 | "karma-chrome-launcher": "~2.2.0", 94 | "karma-coverage-istanbul-reporter": "~2.0.0", 95 | "karma-jasmine": "~1.1.1", 96 | "karma-jasmine-html-reporter": "^0.2.2", 97 | "ngx-typeahead": "^6.0.2", 98 | "protractor": "^5.4.0", 99 | "ts-node": "~5.0.1", 100 | "tslint": "~5.9.1", 101 | "typescript": "~2.7.2" 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ngApp": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/ngApp", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "fileReplacements": [ 33 | { 34 | "replace": "src/environments/environment.ts", 35 | "with": "src/environments/environment.prod.ts" 36 | } 37 | ], 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true 47 | } 48 | } 49 | }, 50 | "serve": { 51 | "builder": "@angular-devkit/build-angular:dev-server", 52 | "options": { 53 | "browserTarget": "ngApp:build" 54 | }, 55 | "configurations": { 56 | "production": { 57 | "browserTarget": "ngApp:build:production" 58 | } 59 | } 60 | }, 61 | "extract-i18n": { 62 | "builder": "@angular-devkit/build-angular:extract-i18n", 63 | "options": { 64 | "browserTarget": "ngApp:build" 65 | } 66 | }, 67 | "test": { 68 | "builder": "@angular-devkit/build-angular:karma", 69 | "options": { 70 | "main": "src/test.ts", 71 | "polyfills": "src/polyfills.ts", 72 | "tsConfig": "src/tsconfig.spec.json", 73 | "karmaConfig": "src/karma.conf.js", 74 | "styles": [ 75 | "src/styles.css" 76 | ], 77 | "scripts": [], 78 | "assets": [ 79 | "src/favicon.ico", 80 | "src/assets" 81 | ] 82 | } 83 | }, 84 | "lint": { 85 | "builder": "@angular-devkit/build-angular:tslint", 86 | "options": { 87 | "tsConfig": [ 88 | "src/tsconfig.app.json", 89 | "src/tsconfig.spec.json" 90 | ], 91 | "exclude": [ 92 | "**/node_modules/**" 93 | ] 94 | } 95 | } 96 | } 97 | }, 98 | "ngApp-e2e": { 99 | "root": "e2e/", 100 | "projectType": "application", 101 | "architect": { 102 | "e2e": { 103 | "builder": "@angular-devkit/build-angular:protractor", 104 | "options": { 105 | "protractorConfig": "e2e/protractor.conf.js", 106 | "devServerTarget": "ngApp:serve" 107 | }, 108 | "configurations": { 109 | "production": { 110 | "devServerTarget": "ngApp:serve:production" 111 | } 112 | } 113 | }, 114 | "lint": { 115 | "builder": "@angular-devkit/build-angular:tslint", 116 | "options": { 117 | "tsConfig": "e2e/tsconfig.e2e.json", 118 | "exclude": [ 119 | "**/node_modules/**" 120 | ] 121 | } 122 | } 123 | } 124 | } 125 | }, 126 | "defaultProject": "ngApp" 127 | } -------------------------------------------------------------------------------- /src/app/components/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 61 | 62 |
63 |
64 |
65 |
    66 |
    67 | 68 |
    69 |

    {{data.title}}

    70 |

    Author: {{data.metadata.author}}

    71 |
    72 |

    73 | Read more... 74 |
    75 |
76 |
77 |
78 |
79 | 80 |
81 |
82 |

Enter a New Blog Here:

83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 | 91 |
92 |
93 | 94 |
95 | 96 |
97 | 98 | 99 |
100 | 101 |
102 | 103 | 104 |
105 |
106 | 107 |
108 |

{{message}}

109 |
110 |
111 |
112 |
113 |
114 |
-------------------------------------------------------------------------------- /src/app/services/cosmic.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | import { Router } from '@angular/router'; 4 | import {config} from '../../config/cosmo.config' 5 | import {blogModel} from '../models/cosmic.model'; 6 | import {registerModel} from '../models/cosmic.model'; 7 | 8 | 9 | @Injectable() 10 | 11 | export class CosmicService { 12 | data; 13 | message; 14 | URL = config.URL; 15 | bucket_slug = config.bucket_slug; 16 | constructor(private _http: Http, private router: Router) 17 | {} 18 | 19 | /** getting details of user */ 20 | getUser(registerModel: registerModel) { 21 | return this._http.get(this.URL+this.bucket_slug+"/object-type/registerusers/search", { 22 | params: { 23 | metafield_key: 'username', 24 | metafield_value: registerModel.username, 25 | limit: 1, 26 | read_key: config.read_key 27 | } 28 | }) 29 | .map(res => { 30 | return res; 31 | }) 32 | } 33 | 34 | /** register new user */ 35 | addUser(registerModel : registerModel) 36 | { 37 | return this._http.post(this.URL+this.bucket_slug+"/add-object/", { 38 | title: registerModel.username, slug: registerModel.username, type_slug: 'registerusers', write_key: config.write_key, 39 | 40 | metafields: [ 41 | { 42 | title:"Username", 43 | key: "username", 44 | type: "text", 45 | value: registerModel.username 46 | }, 47 | 48 | { 49 | title:"Email", 50 | key: "email", 51 | type: "text", 52 | value: registerModel.email 53 | }, 54 | 55 | { 56 | title:"Full Name", 57 | key: "fullName", 58 | type: "text", 59 | value: registerModel.fullName 60 | }, 61 | 62 | { 63 | title:"Password", 64 | key: "password", 65 | type: "text", 66 | value: registerModel.password 67 | }, 68 | { 69 | title:"Image URL", 70 | key: "imageUrl", 71 | type: "text", 72 | value: registerModel.imageUrl 73 | } 74 | ], 75 | }) 76 | .map(res => { 77 | return res; 78 | }) 79 | } 80 | /** add blog to backend */ 81 | addBlog(blogModel: blogModel) 82 | { 83 | var jsondata = JSON.parse(localStorage.getItem('user')); 84 | const userName = jsondata.jsondata.objects[0].metadata.username; 85 | 86 | return this._http.post(this.URL+this.bucket_slug+"/add-object/", { 87 | title: blogModel.title, content: blogModel.content, slug: blogModel.title, type_slug: 'blogs', write_key: config.write_key, 88 | metafields: [ 89 | { 90 | title: "Author", 91 | key: "author", 92 | type: "text", 93 | value: userName 94 | }, 95 | { 96 | title: "Description", 97 | key: "description", 98 | type: "text", 99 | value: blogModel.description 100 | }, 101 | { 102 | title: "Blog Image", 103 | key: "blogImage", 104 | type: "text", 105 | value: blogModel.blogImage 106 | }, 107 | ] 108 | }) 109 | .map(res => { 110 | return res; 111 | }) 112 | 113 | } 114 | 115 | //showing all blogs 116 | 117 | showAllBlogs() 118 | { 119 | return this._http.get(this.URL+this.bucket_slug+"/object-type/blogs", { 120 | 121 | params: { 122 | 123 | read_key: config.read_key, 124 | } 125 | }) 126 | .map(res => { 127 | return res; 128 | }) 129 | } 130 | 131 | //show blogs of logged in user 132 | showBlogs() 133 | { 134 | var jsondata = JSON.parse(localStorage.getItem('user')); 135 | const userName = jsondata.jsondata.objects[0].metadata.username; 136 | return this._http.get(this.URL+this.bucket_slug+"/object-type/blogs/search", { 137 | 138 | params: { 139 | 140 | metafield_key: 'author', 141 | metafield_value: userName, 142 | read_key: config.read_key, 143 | } 144 | }) 145 | } 146 | 147 | /** showing single post on dashboard */ 148 | showSinglePostDashboard() 149 | { 150 | return this._http.get(this.URL+this.bucket_slug+"/object-type/blogs/", { 151 | params: { 152 | 153 | read_key: config.read_key, 154 | } 155 | }) 156 | .map(res => { 157 | return res; 158 | }) 159 | } 160 | 161 | /** showing single post on home page */ 162 | singlePostHome() 163 | { 164 | return this._http.get(this.URL+this.bucket_slug+"/object-type/blogs/", { 165 | 166 | params: { 167 | read_key: config.read_key 168 | } 169 | }) 170 | } 171 | 172 | /** loggin user in */ 173 | login(registerModel: registerModel) 174 | { 175 | return this._http.get(this.URL+this.bucket_slug+"/object-type/registerusers/search", { 176 | 177 | params: { 178 | metafield_key: 'username', 179 | metafield_value: registerModel.username, 180 | limit: 1, 181 | read_key: config.read_key 182 | } 183 | }) 184 | } 185 | 186 | // saveComment(commentModel: commentModel ) 187 | // { 188 | // return this._http.post(this.URL+this.bucket_slug+"/add-object/", { 189 | // title: commentModel.name, content: commentModel.comment, slug: commentModel.name, type_slug: 'comments', write_key: config.write_key, 190 | // metafields: [ 191 | // { 192 | // key: "name", 193 | // type: "text", 194 | // value: commentModel.name 195 | // }, 196 | // { 197 | // key: "slug", 198 | // type: "text", 199 | // value: commentModel.slug 200 | // }, 201 | // ] 202 | // }) 203 | // .map(res => { 204 | // return res; 205 | // }) 206 | 207 | // } 208 | } 209 | -------------------------------------------------------------------------------- /dist/ngApp/3rdpartylicenses.txt: -------------------------------------------------------------------------------- 1 | core-js@2.5.7 2 | MIT 3 | Copyright (c) 2014-2018 Denis Pushkarev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | zone.js@0.8.26 24 | MIT 25 | The MIT License 26 | 27 | Copyright (c) 2016-2018 Google, Inc. 28 | 29 | Permission is hereby granted, free of charge, to any person obtaining a copy 30 | of this software and associated documentation files (the "Software"), to deal 31 | in the Software without restriction, including without limitation the rights 32 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 33 | copies of the Software, and to permit persons to whom the Software is 34 | furnished to do so, subject to the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be included in 37 | all copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 41 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 42 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 43 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 44 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 45 | THE SOFTWARE. 46 | 47 | rxjs@6.2.2 48 | Apache-2.0 49 | Apache License 50 | Version 2.0, January 2004 51 | http://www.apache.org/licenses/ 52 | 53 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 54 | 55 | 1. Definitions. 56 | 57 | "License" shall mean the terms and conditions for use, reproduction, 58 | and distribution as defined by Sections 1 through 9 of this document. 59 | 60 | "Licensor" shall mean the copyright owner or entity authorized by 61 | the copyright owner that is granting the License. 62 | 63 | "Legal Entity" shall mean the union of the acting entity and all 64 | other entities that control, are controlled by, or are under common 65 | control with that entity. For the purposes of this definition, 66 | "control" means (i) the power, direct or indirect, to cause the 67 | direction or management of such entity, whether by contract or 68 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 69 | outstanding shares, or (iii) beneficial ownership of such entity. 70 | 71 | "You" (or "Your") shall mean an individual or Legal Entity 72 | exercising permissions granted by this License. 73 | 74 | "Source" form shall mean the preferred form for making modifications, 75 | including but not limited to software source code, documentation 76 | source, and configuration files. 77 | 78 | "Object" form shall mean any form resulting from mechanical 79 | transformation or translation of a Source form, including but 80 | not limited to compiled object code, generated documentation, 81 | and conversions to other media types. 82 | 83 | "Work" shall mean the work of authorship, whether in Source or 84 | Object form, made available under the License, as indicated by a 85 | copyright notice that is included in or attached to the work 86 | (an example is provided in the Appendix below). 87 | 88 | "Derivative Works" shall mean any work, whether in Source or Object 89 | form, that is based on (or derived from) the Work and for which the 90 | editorial revisions, annotations, elaborations, or other modifications 91 | represent, as a whole, an original work of authorship. For the purposes 92 | of this License, Derivative Works shall not include works that remain 93 | separable from, or merely link (or bind by name) to the interfaces of, 94 | the Work and Derivative Works thereof. 95 | 96 | "Contribution" shall mean any work of authorship, including 97 | the original version of the Work and any modifications or additions 98 | to that Work or Derivative Works thereof, that is intentionally 99 | submitted to Licensor for inclusion in the Work by the copyright owner 100 | or by an individual or Legal Entity authorized to submit on behalf of 101 | the copyright owner. For the purposes of this definition, "submitted" 102 | means any form of electronic, verbal, or written communication sent 103 | to the Licensor or its representatives, including but not limited to 104 | communication on electronic mailing lists, source code control systems, 105 | and issue tracking systems that are managed by, or on behalf of, the 106 | Licensor for the purpose of discussing and improving the Work, but 107 | excluding communication that is conspicuously marked or otherwise 108 | designated in writing by the copyright owner as "Not a Contribution." 109 | 110 | "Contributor" shall mean Licensor and any individual or Legal Entity 111 | on behalf of whom a Contribution has been received by Licensor and 112 | subsequently incorporated within the Work. 113 | 114 | 2. Grant of Copyright License. Subject to the terms and conditions of 115 | this License, each Contributor hereby grants to You a perpetual, 116 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 117 | copyright license to reproduce, prepare Derivative Works of, 118 | publicly display, publicly perform, sublicense, and distribute the 119 | Work and such Derivative Works in Source or Object form. 120 | 121 | 3. Grant of Patent License. Subject to the terms and conditions of 122 | this License, each Contributor hereby grants to You a perpetual, 123 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 124 | (except as stated in this section) patent license to make, have made, 125 | use, offer to sell, sell, import, and otherwise transfer the Work, 126 | where such license applies only to those patent claims licensable 127 | by such Contributor that are necessarily infringed by their 128 | Contribution(s) alone or by combination of their Contribution(s) 129 | with the Work to which such Contribution(s) was submitted. If You 130 | institute patent litigation against any entity (including a 131 | cross-claim or counterclaim in a lawsuit) alleging that the Work 132 | or a Contribution incorporated within the Work constitutes direct 133 | or contributory patent infringement, then any patent licenses 134 | granted to You under this License for that Work shall terminate 135 | as of the date such litigation is filed. 136 | 137 | 4. Redistribution. You may reproduce and distribute copies of the 138 | Work or Derivative Works thereof in any medium, with or without 139 | modifications, and in Source or Object form, provided that You 140 | meet the following conditions: 141 | 142 | (a) You must give any other recipients of the Work or 143 | Derivative Works a copy of this License; and 144 | 145 | (b) You must cause any modified files to carry prominent notices 146 | stating that You changed the files; and 147 | 148 | (c) You must retain, in the Source form of any Derivative Works 149 | that You distribute, all copyright, patent, trademark, and 150 | attribution notices from the Source form of the Work, 151 | excluding those notices that do not pertain to any part of 152 | the Derivative Works; and 153 | 154 | (d) If the Work includes a "NOTICE" text file as part of its 155 | distribution, then any Derivative Works that You distribute must 156 | include a readable copy of the attribution notices contained 157 | within such NOTICE file, excluding those notices that do not 158 | pertain to any part of the Derivative Works, in at least one 159 | of the following places: within a NOTICE text file distributed 160 | as part of the Derivative Works; within the Source form or 161 | documentation, if provided along with the Derivative Works; or, 162 | within a display generated by the Derivative Works, if and 163 | wherever such third-party notices normally appear. The contents 164 | of the NOTICE file are for informational purposes only and 165 | do not modify the License. You may add Your own attribution 166 | notices within Derivative Works that You distribute, alongside 167 | or as an addendum to the NOTICE text from the Work, provided 168 | that such additional attribution notices cannot be construed 169 | as modifying the License. 170 | 171 | You may add Your own copyright statement to Your modifications and 172 | may provide additional or different license terms and conditions 173 | for use, reproduction, or distribution of Your modifications, or 174 | for any such Derivative Works as a whole, provided Your use, 175 | reproduction, and distribution of the Work otherwise complies with 176 | the conditions stated in this License. 177 | 178 | 5. Submission of Contributions. Unless You explicitly state otherwise, 179 | any Contribution intentionally submitted for inclusion in the Work 180 | by You to the Licensor shall be under the terms and conditions of 181 | this License, without any additional terms or conditions. 182 | Notwithstanding the above, nothing herein shall supersede or modify 183 | the terms of any separate license agreement you may have executed 184 | with Licensor regarding such Contributions. 185 | 186 | 6. Trademarks. This License does not grant permission to use the trade 187 | names, trademarks, service marks, or product names of the Licensor, 188 | except as required for reasonable and customary use in describing the 189 | origin of the Work and reproducing the content of the NOTICE file. 190 | 191 | 7. Disclaimer of Warranty. Unless required by applicable law or 192 | agreed to in writing, Licensor provides the Work (and each 193 | Contributor provides its Contributions) on an "AS IS" BASIS, 194 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 195 | implied, including, without limitation, any warranties or conditions 196 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 197 | PARTICULAR PURPOSE. You are solely responsible for determining the 198 | appropriateness of using or redistributing the Work and assume any 199 | risks associated with Your exercise of permissions under this License. 200 | 201 | 8. Limitation of Liability. In no event and under no legal theory, 202 | whether in tort (including negligence), contract, or otherwise, 203 | unless required by applicable law (such as deliberate and grossly 204 | negligent acts) or agreed to in writing, shall any Contributor be 205 | liable to You for damages, including any direct, indirect, special, 206 | incidental, or consequential damages of any character arising as a 207 | result of this License or out of the use or inability to use the 208 | Work (including but not limited to damages for loss of goodwill, 209 | work stoppage, computer failure or malfunction, or any and all 210 | other commercial damages or losses), even if such Contributor 211 | has been advised of the possibility of such damages. 212 | 213 | 9. Accepting Warranty or Additional Liability. While redistributing 214 | the Work or Derivative Works thereof, You may choose to offer, 215 | and charge a fee for, acceptance of support, warranty, indemnity, 216 | or other liability obligations and/or rights consistent with this 217 | License. However, in accepting such obligations, You may act only 218 | on Your own behalf and on Your sole responsibility, not on behalf 219 | of any other Contributor, and only if You agree to indemnify, 220 | defend, and hold each Contributor harmless for any liability 221 | incurred by, or claims asserted against, such Contributor by reason 222 | of your accepting any such warranty or additional liability. 223 | 224 | END OF TERMS AND CONDITIONS 225 | 226 | APPENDIX: How to apply the Apache License to your work. 227 | 228 | To apply the Apache License to your work, attach the following 229 | boilerplate notice, with the fields enclosed by brackets "[]" 230 | replaced with your own identifying information. (Don't include 231 | the brackets!) The text should be enclosed in the appropriate 232 | comment syntax for the file format. We also recommend that a 233 | file or class name and description of purpose be included on the 234 | same "printed page" as the copyright notice for easier 235 | identification within third-party archives. 236 | 237 | Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors 238 | 239 | Licensed under the Apache License, Version 2.0 (the "License"); 240 | you may not use this file except in compliance with the License. 241 | You may obtain a copy of the License at 242 | 243 | http://www.apache.org/licenses/LICENSE-2.0 244 | 245 | Unless required by applicable law or agreed to in writing, software 246 | distributed under the License is distributed on an "AS IS" BASIS, 247 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 248 | See the License for the specific language governing permissions and 249 | limitations under the License. 250 | 251 | @angular/common@6.1.0 252 | MIT 253 | MIT 254 | 255 | tslib@1.9.3 256 | Apache-2.0 257 | Apache License 258 | 259 | Version 2.0, January 2004 260 | 261 | http://www.apache.org/licenses/ 262 | 263 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 264 | 265 | 1. Definitions. 266 | 267 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 268 | 269 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 270 | 271 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 272 | 273 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 274 | 275 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 276 | 277 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 278 | 279 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 280 | 281 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 282 | 283 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 284 | 285 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 286 | 287 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 288 | 289 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 290 | 291 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 292 | 293 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 294 | 295 | You must cause any modified files to carry prominent notices stating that You changed the files; and 296 | 297 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 298 | 299 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 300 | 301 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 302 | 303 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 304 | 305 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 306 | 307 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 308 | 309 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 310 | 311 | END OF TERMS AND CONDITIONS 312 | 313 | ngx-dropdown@0.0.22 314 | MIT 315 | MIT 316 | 317 | @angular/core@6.1.0 318 | MIT 319 | MIT -------------------------------------------------------------------------------- /dist/ngApp/polyfills.2f4a59095805af02bd79.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"+rLv":function(e,t,n){var r=n("dyZX").document;e.exports=r&&r.documentElement},"0/R4":function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},"0TWp":function(e,t,n){!function(){"use strict";!function(e){var t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function r(e,n){t&&t.measure&&t.measure(e,n)}if(n("Zone"),e.Zone)throw new Error("Zone already loaded.");var o,i=function(){function t(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new c(this,this._parent&&this._parent._zoneDelegate,t)}return t.assertZonePatched=function(){if(e.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(t,"root",{get:function(){for(var e=t.current;e.parent;)e=e.parent;return e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"current",{get:function(){return D.zone},enumerable:!0,configurable:!0}),Object.defineProperty(t,"currentTask",{get:function(){return j},enumerable:!0,configurable:!0}),t.__load_patch=function(o,i){if(O.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!e["__Zone_disable_"+o]){var a="Zone:"+o;n(a),O[o]=i(e,t,S),r(a,a)}},Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},t.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},t.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},t.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},t.prototype.run=function(e,t,n,r){void 0===t&&(t=void 0),void 0===n&&(n=null),void 0===r&&(r=null),D={parent:D,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{D=D.parent}},t.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),D={parent:D,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{D=D.parent}},t.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state!==y||e.type!==x){var r=e.state!=k;r&&e._transitionTo(k,m),e.runCount++;var o=j;j=e,D={parent:D,zone:this};try{e.type==E&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{e.state!==y&&e.state!==T&&(e.type==x||e.data&&e.data.isPeriodic?r&&e._transitionTo(m,k):(e.runCount=0,this._updateTaskCount(e,-1),r&&e._transitionTo(y,k,y))),D=D.parent,j=o}}},t.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+e.zone.name);t=t.parent}e._transitionTo(_,y);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(T,_,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==_&&e._transitionTo(m,_),e},t.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new u(w,e,t,n,r,null))},t.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new u(E,e,t,n,r,o))},t.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new u(x,e,t,n,r,o))},t.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");e._transitionTo(b,m,k);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(T,b),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,b),e.runCount=0,e},t.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(var r=0;r0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})},e}(),u=function(){function t(n,r,o,i,a,c){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=i,this.scheduleFn=a,this.cancelFn=c,this.callback=o;var u=this;this.invoke=n===x&&i&&i.useG?t.invokeTask:function(){return t.invokeTask.call(e,u,this,arguments)}}return t.invokeTask=function(e,t,n){e||(e=this),P++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==P&&d(),P--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(y,_)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+e+"', expecting state '"+t+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=e,e==y&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&void 0!==this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},t}(),s=z("setTimeout"),l=z("Promise"),f=z("then"),p=[],h=!1;function v(t){0===P&&0===p.length&&(o||e[l]&&(o=e[l].resolve(0)),o?o[f](d):e[s](d,0)),t&&p.push(t)}function d(){if(!h){for(h=!0;p.length;){var e=p;p=[];for(var t=0;t=0;n--)"function"==typeof e[n]&&(e[n]=p(e[n],t+"_"+n));return e}function b(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}var T="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,w=!("nw"in y)&&void 0!==y.process&&"[object process]"==={}.toString.call(y.process),E=!w&&!T&&!(!d||!g.HTMLElement),x=void 0!==y.process&&"[object process]"==={}.toString.call(y.process)&&!T&&!(!d||!g.HTMLElement),O={},S=function(e){if(e=e||y.event){var t=O[e.type];t||(t=O[e.type]=v("ON_PROPERTY"+e.type));var n=(this||e.target||y)[t],r=n&&n.apply(this,arguments);return void 0==r||r||e.preventDefault(),r}};function D(n,r,o){var i=e(n,r);if(!i&&o&&e(o,r)&&(i={enumerable:!0,configurable:!0}),i&&i.configurable){delete i.writable,delete i.value;var a=i.get,c=i.set,u=r.substr(2),s=O[u];s||(s=O[u]=v("ON_PROPERTY"+u)),i.set=function(e){var t=this;t||n!==y||(t=y),t&&(t[s]&&t.removeEventListener(u,S),c&&c.apply(t,m),"function"==typeof e?(t[s]=e,t.addEventListener(u,S,!1)):t[s]=null)},i.get=function(){var e=this;if(e||n!==y||(e=y),!e)return null;var t=e[s];if(t)return t;if(a){var o=a&&a.call(this);if(o)return i.set.call(this,o),"function"==typeof e[_]&&e.removeAttribute(r),o}return null},t(n,r,i)}}function j(e,t,n){if(t)for(var r=0;r1?new c(t,n):new c(t),f=e(l,"onmessage");return f&&!1===f.configurable?(u=r(l),s=l,[i,a,"send","close"].forEach(function(e){u[e]=function(){var t=o.call(arguments);if(e===i||e===a){var n=t.length>0?t[0]:void 0;if(n){var r=Zone.__symbol__("ON_PROPERTY"+n);l[r]=u[r]}}return l[e].apply(l,t)}})):u=l,j(u,["close","error","message","open"],s),u};var u=n.WebSocket;for(var s in c)u[s]=c[s]}(0,u)}}var fe=v("unbound");Zone.__load_patch("util",function(e,t,n){n.patchOnProperties=j,n.patchMethod=z,n.bindArguments=k}),Zone.__load_patch("timers",function(e){K(e,"set","clear","Timeout"),K(e,"set","clear","Interval"),K(e,"set","clear","Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e){K(e,"request","cancel","AnimationFrame"),K(e,"mozRequest","mozCancel","AnimationFrame"),K(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(e,t){for(var n=["alert","prompt","confirm"],r=0;r=0&&"function"==typeof n[r.cbIdx]?h(r.name,n[r.cbIdx],r,i,null):e.apply(t,n)}})}()}),Zone.__load_patch("XHR",function(e,t){!function(t){var s=XMLHttpRequest.prototype,l=s[c],f=s[u];if(!l){var p=e.XMLHttpRequestEventTarget;if(p){var v=p.prototype;l=v[c],f=v[u]}}var d="readystatechange",g="scheduled";function y(e){XMLHttpRequest[i]=!1;var t=e.data,r=t.target,a=r[o];l||(l=r[c],f=r[u]),a&&f.call(r,d,a);var s=r[o]=function(){r.readyState===r.DONE&&!t.aborted&&XMLHttpRequest[i]&&e.state===g&&e.invoke()};return l.call(r,d,s),r[n]||(r[n]=e),b.apply(r,t.args),XMLHttpRequest[i]=!0,e}function _(){}function m(e){var t=e.data;return t.aborted=!0,T.apply(t.target,t.args)}var k=z(s,"open",function(){return function(e,t){return e[r]=0==t[2],e[a]=t[1],k.apply(e,t)}}),b=z(s,"send",function(){return function(e,t){return e[r]?b.apply(e,t):h("XMLHttpRequest.send",_,{target:e,url:e[a],isPeriodic:!1,delay:null,args:t,aborted:!1},y,m)}}),T=z(s,"abort",function(){return function(e){var t=e[n];if(t&&"string"==typeof t.type){if(null==t.cancelFn||t.data&&t.data.aborted)return;t.zone.cancelTask(t)}}})}();var n=v("xhrTask"),r=v("xhrSync"),o=v("xhrListener"),i=v("xhrScheduled"),a=v("xhrURL")}),Zone.__load_patch("geolocation",function(t){t.navigator&&t.navigator.geolocation&&function(t,n){for(var r=t.constructor.name,o=function(o){var i=n[o],a=t[i];if(a){if(!b(e(t,i)))return"continue";t[i]=function(e){var t=function(){return e.apply(this,k(arguments,r+"."+i))};return M(t,e),t}(a)}},i=0;i0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},"9gX7":function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},Afnz:function(e,t,n){"use strict";var r=n("LQAc"),o=n("XKFU"),i=n("KroJ"),a=n("Mukb"),c=n("hPIQ"),u=n("QaDb"),s=n("fyDq"),l=n("OP3Y"),f=n("K0xU")("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,v,d,g,y){u(n,t,v);var _,m,k,b=function(e){if(!p&&e in x)return x[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+" Iterator",w="values"==d,E=!1,x=e.prototype,O=x[f]||x["@@iterator"]||d&&x[d],S=O||b(d),D=d?w?b("entries"):S:void 0,j="Array"==t&&x.entries||O;if(j&&(k=l(j.call(new e)))!==Object.prototype&&k.next&&(s(k,T,!0),r||"function"==typeof k[f]||a(k,f,h)),w&&O&&"values"!==O.name&&(E=!0,S=function(){return O.call(this)}),r&&!y||!p&&!E&&x[f]||a(x,f,S),c[t]=S,c[T]=h,d)if(_={values:w?S:b("values"),keys:g?S:b("keys"),entries:D},y)for(m in _)m in x||i(x,m,_[m]);else o(o.P+o.F*(p||E),t,_);return _}},BqfV:function(e,t,n){var r=n("N6cJ"),o=n("y3w9"),i=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return i(e,o(t),arguments.length<3?void 0:a(arguments[2]))}})},CkkT:function(e,t,n){var r=n("m0Pp"),o=n("Ymqv"),i=n("S/j/"),a=n("ne8i"),c=n("zRwo");e.exports=function(e,t){var n=1==e,u=2==e,s=3==e,l=4==e,f=6==e,p=5==e||f,h=t||c;return function(t,c,v){for(var d,g,y=i(t),_=o(y),m=r(c,v,3),k=a(_.length),b=0,T=n?h(t,k):u?h(t,0):void 0;k>b;b++)if((p||b in _)&&(g=m(d=_[b],b,y),e))if(n)T[b]=g;else if(g)switch(e){case 3:return!0;case 5:return d;case 6:return b;case 2:T.push(d)}else if(l)return!1;return f?-1:s||l?l:T}}},DVgA:function(e,t,n){var r=n("zhAb"),o=n("4R4u");e.exports=Object.keys||function(e){return r(e,o)}},EK0E:function(e,t,n){"use strict";var r,o=n("CkkT")(0),i=n("KroJ"),a=n("Z6vF"),c=n("czNK"),u=n("ZD67"),s=n("0/R4"),l=n("eeVq"),f=n("s5qY"),p=a.getWeak,h=Object.isExtensible,v=u.ufstore,d={},g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(s(e)){var t=p(e);return!0===t?v(f(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(f(this,"WeakMap"),e,t)}},_=e.exports=n("4LiD")("WeakMap",g,y,u,!0,!0);l(function(){return 7!=(new _).set((Object.freeze||Object)(d),7).get(d)})&&(c((r=u.getConstructor(g,"WeakMap")).prototype,y),a.NEED=!0,o(["delete","has","get","set"],function(e){var t=_.prototype,n=t[e];i(t,e,function(t,o){if(s(t)&&!h(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},EWmC:function(e,t,n){var r=n("LZWt");e.exports=Array.isArray||function(e){return"Array"==r(e)}},EemH:function(e,t,n){var r=n("UqcF"),o=n("RjD/"),i=n("aCFj"),a=n("apmT"),c=n("aagx"),u=n("xpql"),s=Object.getOwnPropertyDescriptor;t.f=n("nh4g")?s:function(e,t){if(e=i(e),t=a(t,!0),u)try{return s(e,t)}catch(e){}if(c(e,t))return o(!r.f.call(e,t),e[t])}},FJW5:function(e,t,n){var r=n("hswa"),o=n("y3w9"),i=n("DVgA");e.exports=n("nh4g")?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),c=a.length,u=0;c>u;)r.f(e,n=a[u++],t[n]);return e}},FZcq:function(e,t,n){n("49D4"),n("zq+C"),n("45Tv"),n("uAtd"),n("BqfV"),n("fN/3"),n("iW+S"),n("7Dlh"),n("Opxb"),e.exports=n("g3g5").Reflect},H6hf:function(e,t,n){var r=n("y3w9");e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},"I8a+":function(e,t,n){var r=n("LZWt"),o=n("K0xU")("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},Iw71:function(e,t,n){var r=n("0/R4"),o=n("dyZX").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"J+6e":function(e,t,n){var r=n("I8a+"),o=n("K0xU")("iterator"),i=n("hPIQ");e.exports=n("g3g5").getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},JiEa:function(e,t){t.f=Object.getOwnPropertySymbols},K0xU:function(e,t,n){var r=n("VTer")("wks"),o=n("ylqs"),i=n("dyZX").Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},KroJ:function(e,t,n){var r=n("dyZX"),o=n("Mukb"),i=n("aagx"),a=n("ylqs")("src"),c=Function.toString,u=(""+c).split("toString");n("g3g5").inspectSource=function(e){return c.call(e)},(e.exports=function(e,t,n,c){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(s&&(i(n,a)||o(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:c?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||c.call(this)})},Kuth:function(e,t,n){var r=n("y3w9"),o=n("FJW5"),i=n("4R4u"),a=n("YTvA")("IE_PROTO"),c=function(){},u=function(){var e,t=n("Iw71")("iframe"),r=i.length;for(t.style.display="none",n("+rLv").appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("