├── license-banner.txt ├── .gitignore ├── src ├── enums │ └── cache-storages.enum.ts ├── ng2-cache.module.ts ├── interfaces │ ├── storage-value.interface.ts │ └── cache-options.interface.ts ├── ng2-cache.ts └── services │ ├── storage │ ├── memory │ │ └── cache-memory.service.ts │ ├── cache-storage-abstract.service.ts │ ├── local-storage │ │ └── cache-local-storage.service.ts │ └── session-storage │ │ └── cache-session-storage.service.ts │ └── cache.service.ts ├── ng2-cache.ts ├── public_api.ts ├── .travis.yml ├── tslint.json ├── rollup.es.config.js ├── tsconfig.json ├── LICENSE ├── tsconfig-build.json ├── rollup.config.js ├── package.json ├── CHANGELOG.md └── README.md /license-banner.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license ng2-cache 3 | * MIT license 4 | */ 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | $ cat .gitignore 2 | /node_modules 3 | /dist 4 | /documentation 5 | /coverage 6 | 7 | *.log 8 | *.tgz 9 | -------------------------------------------------------------------------------- /src/enums/cache-storages.enum.ts: -------------------------------------------------------------------------------- 1 | export const enum CacheStoragesEnum { 2 | LOCAL_STORAGE, 3 | SESSION_STORAGE, 4 | MEMORY 5 | } 6 | -------------------------------------------------------------------------------- /src/ng2-cache.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule} from '@angular/core'; 2 | import { CacheService } from './services/cache.service'; 3 | 4 | @NgModule({ 5 | providers: [ CacheService ] 6 | }) 7 | export class Ng2CacheModule {} 8 | -------------------------------------------------------------------------------- /ng2-cache.ts: -------------------------------------------------------------------------------- 1 | // This file is not used to build the module. It is only used during editing 2 | // by the TypeScript language service and during build for verification. `ngc` 3 | // replaces this file with production ng2-cache.ts when it rewrites 4 | // private symbol names. 5 | 6 | export * from './public_api'; 7 | -------------------------------------------------------------------------------- /src/interfaces/storage-value.interface.ts: -------------------------------------------------------------------------------- 1 | import {CacheOptionsInterface} from './cache-options.interface'; 2 | 3 | export interface StorageValueInterface { 4 | 5 | /** 6 | * Cached data 7 | */ 8 | value: any; 9 | 10 | /** 11 | * Cached options 12 | */ 13 | options: CacheOptionsInterface; 14 | } 15 | -------------------------------------------------------------------------------- /src/interfaces/cache-options.interface.ts: -------------------------------------------------------------------------------- 1 | export interface CacheOptionsInterface { 2 | 3 | /** 4 | * Expires timestamp 5 | */ 6 | expires?: number; 7 | 8 | /** 9 | * Max age in seconds 10 | */ 11 | maxAge?: number; 12 | 13 | /** 14 | * Tag for this key 15 | */ 16 | tag?: string; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /public_api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Angular library starter 3 | * Build an Angular library compatible with AoT compilation & Tree shaking like an official package 4 | * Copyright Roberto Simonetti 5 | * MIT license 6 | * https://github.com/robisim74/angular-library-starter 7 | */ 8 | 9 | /** 10 | * Entry point for all public APIs of the package. 11 | */ 12 | export * from './src/ng2-cache'; 13 | 14 | // This file only reexports content of the `src` folder. Keep it that way. 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | addons: 4 | apt: 5 | sources: 6 | - google-chrome 7 | packages: 8 | - google-chrome-stable 9 | language: node_js 10 | node_js: 11 | - "8" 12 | before_install: 13 | - npm i npm@^4 -g 14 | install: 15 | - npm install 16 | script: 17 | - npm test 18 | - npm run build 19 | before_script: 20 | - export DISPLAY=:99.0 21 | - sh -e /etc/init.d/xvfb start 22 | - sleep 3 23 | notifications: 24 | email: false 25 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "tslint-angular" 4 | ], 5 | "rules": { 6 | "directive-selector": [ 7 | true, 8 | "attribute", 9 | [ 10 | "dir-prefix1", 11 | "dir-prefix2" 12 | ], 13 | "camelCase" 14 | ], 15 | "component-selector": [ 16 | true, 17 | "element", 18 | [ 19 | "cmp-prefix1", 20 | "cmp-prefix2" 21 | ], 22 | "kebab-case" 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /rollup.es.config.js: -------------------------------------------------------------------------------- 1 | import sourcemaps from 'rollup-plugin-sourcemaps'; 2 | import license from 'rollup-plugin-license'; 3 | 4 | const path = require('path'); 5 | 6 | export default { 7 | output: { 8 | format: 'es', 9 | sourcemap: true 10 | }, 11 | plugins: [ 12 | sourcemaps(), 13 | license({ 14 | sourceMap: true, 15 | 16 | banner: { 17 | file: path.join(__dirname, 'license-banner.txt'), 18 | encoding: 'utf-8', 19 | } 20 | }) 21 | ], 22 | onwarn: () => { return } 23 | } 24 | -------------------------------------------------------------------------------- /src/ng2-cache.ts: -------------------------------------------------------------------------------- 1 | export {CacheService} from './services/cache.service'; 2 | export {CacheStorageAbstract} from './services/storage/cache-storage-abstract.service'; 3 | export {CacheStoragesEnum} from './enums/cache-storages.enum'; 4 | export {CacheLocalStorage} from './services/storage/local-storage/cache-local-storage.service'; 5 | export {CacheMemoryStorage} from './services/storage/memory/cache-memory.service'; 6 | export {CacheOptionsInterface} from './interfaces/cache-options.interface'; 7 | export {CacheSessionStorage} from 8 | './services/storage/session-storage/cache-session-storage.service'; 9 | export {Ng2CacheModule} from './ng2-cache.module'; 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "emitDecoratorMetadata": true, 5 | "experimentalDecorators": true, 6 | "strict": true, 7 | "module": "commonjs", 8 | "moduleResolution": "node", 9 | "rootDir": ".", 10 | "sourceMap": true, 11 | "inlineSources": true, 12 | "target": "es5", 13 | "skipLibCheck": true, 14 | "lib": [ 15 | "es2015", 16 | "dom" 17 | ], 18 | "typeRoots": [ 19 | "node_modules/@types/" 20 | ] 21 | }, 22 | "exclude": [ 23 | "node_modules" 24 | ] 25 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 ng2-cache team 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /src/services/storage/memory/cache-memory.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {CacheStorageAbstract} from '../cache-storage-abstract.service'; 3 | import {CacheStoragesEnum} from '../../../enums/cache-storages.enum'; 4 | import {StorageValueInterface} from '../../../interfaces/storage-value.interface'; 5 | 6 | /** 7 | * Service for storing data in local storage 8 | */ 9 | @Injectable() 10 | export class CacheMemoryStorage extends CacheStorageAbstract { 11 | 12 | private _data: {[key: string]: any} = {}; 13 | 14 | public getItem(key: string) { 15 | return this._data[key] ? this._data[key] : null; 16 | } 17 | 18 | public setItem(key: string, value: StorageValueInterface) { 19 | this._data[key] = value; 20 | return true; 21 | } 22 | 23 | public removeItem(key: string) { 24 | delete this._data[key]; 25 | } 26 | 27 | public clear() { 28 | this._data = []; 29 | } 30 | 31 | public type() { 32 | return CacheStoragesEnum.MEMORY; 33 | } 34 | 35 | public isEnabled() { 36 | return true; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tsconfig-build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": ".", 4 | "baseUrl": ".", 5 | "paths": { 6 | "@angular/*": [ 7 | "node_modules/@angular/*" 8 | ] 9 | }, 10 | "outDir": "dist", 11 | "declaration": true, 12 | "strict": true, 13 | "moduleResolution": "node", 14 | "module": "es2015", 15 | "target": "es2015", 16 | "lib": [ 17 | "es2015", 18 | "dom" 19 | ], 20 | "skipLibCheck": true, 21 | "types": [], 22 | "experimentalDecorators": true, 23 | "emitDecoratorMetadata": true, 24 | "sourceMap": true, 25 | "inlineSources": true 26 | }, 27 | "files": [ 28 | "public_api.ts", 29 | "node_modules/zone.js/dist/zone.js.d.ts" 30 | ], 31 | "angularCompilerOptions": { 32 | "skipTemplateCodegen": true, 33 | "annotateForClosureCompiler": true, 34 | "strictMetadataEmit": true, 35 | "flatModuleOutFile": "ng2-cache.js", 36 | "flatModuleId": "ng2-cache" 37 | } 38 | } -------------------------------------------------------------------------------- /src/services/storage/cache-storage-abstract.service.ts: -------------------------------------------------------------------------------- 1 | import {CacheStoragesEnum} from '../../enums/cache-storages.enum'; 2 | import {StorageValueInterface} from '../../interfaces/storage-value.interface'; 3 | 4 | /** 5 | * Abstract cache storage 6 | */ 7 | export abstract class CacheStorageAbstract { 8 | 9 | /** 10 | * Get item from storage 11 | * @param key 12 | */ 13 | public abstract getItem(key: string): StorageValueInterface; 14 | 15 | /** 16 | * Set item to storage 17 | * @param key 18 | * @param value 19 | */ 20 | public abstract setItem(key: string, value: StorageValueInterface): boolean; 21 | 22 | /** 23 | * Remove item from storage 24 | * @param key 25 | */ 26 | public abstract removeItem(key: string): void; 27 | 28 | /** 29 | * Clear item in storage 30 | */ 31 | public abstract clear(): void; 32 | 33 | /** 34 | * Get current storage type 35 | */ 36 | public abstract type(): CacheStoragesEnum; 37 | 38 | /** 39 | * Check if storage is enabled 40 | */ 41 | public abstract isEnabled(): boolean; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/services/storage/local-storage/cache-local-storage.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {CacheStorageAbstract} from '../cache-storage-abstract.service'; 3 | import {CacheStoragesEnum} from '../../../enums/cache-storages.enum'; 4 | import {StorageValueInterface} from '../../../interfaces/storage-value.interface'; 5 | 6 | /** 7 | * Service for storing data in local storage 8 | */ 9 | @Injectable() 10 | export class CacheLocalStorage extends CacheStorageAbstract { 11 | 12 | public getItem(key: string) { 13 | const value = localStorage.getItem(key); 14 | return value ? JSON.parse(value) : null; 15 | } 16 | 17 | public setItem(key: string, value: StorageValueInterface) { 18 | try { 19 | localStorage.setItem(key, JSON.stringify(value)); 20 | return true; 21 | } catch (e) { 22 | return false; 23 | } 24 | } 25 | 26 | public removeItem(key: string) { 27 | localStorage.removeItem(key); 28 | } 29 | 30 | public clear() { 31 | localStorage.clear(); 32 | } 33 | 34 | public type() { 35 | return CacheStoragesEnum.LOCAL_STORAGE; 36 | } 37 | 38 | public isEnabled() { 39 | try { 40 | localStorage.setItem('test', 'test'); 41 | localStorage.removeItem('test'); 42 | return true; 43 | } catch (e) { 44 | return false; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/services/storage/session-storage/cache-session-storage.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import {CacheStorageAbstract} from '../cache-storage-abstract.service'; 3 | import {CacheStoragesEnum} from '../../../enums/cache-storages.enum'; 4 | import {StorageValueInterface} from '../../../interfaces/storage-value.interface'; 5 | 6 | /** 7 | * Service for storing data in session storage 8 | */ 9 | @Injectable() 10 | export class CacheSessionStorage extends CacheStorageAbstract { 11 | 12 | public getItem(key: string) { 13 | let value = sessionStorage.getItem(key); 14 | return value ? JSON.parse(value) : null; 15 | } 16 | 17 | public setItem(key: string, value: StorageValueInterface) { 18 | try { 19 | sessionStorage.setItem(key, JSON.stringify(value)); 20 | return true; 21 | } catch (e) { 22 | return false; 23 | } 24 | } 25 | 26 | public removeItem(key: string) { 27 | sessionStorage.removeItem(key); 28 | } 29 | 30 | public clear() { 31 | sessionStorage.clear(); 32 | } 33 | 34 | public type() { 35 | return CacheStoragesEnum.SESSION_STORAGE; 36 | } 37 | 38 | public isEnabled() { 39 | try { 40 | sessionStorage.setItem('test', 'test'); 41 | sessionStorage.removeItem('test'); 42 | return true; 43 | } catch (e) { 44 | return false; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import resolve from 'rollup-plugin-node-resolve'; 2 | import sourcemaps from 'rollup-plugin-sourcemaps'; 3 | 4 | /** 5 | * Add here external dependencies that actually you use. 6 | * 7 | * Angular dependencies 8 | * - '@angular/animations' => 'ng.animations' 9 | * - '@angular/animations/browser': 'ng.animations.browser' 10 | * - '@angular/common' => 'ng.common' 11 | * - '@angular/compiler' => 'ng.compiler' 12 | * - '@angular/core' => 'ng.core' 13 | * - '@angular/forms' => 'ng.forms' 14 | * - '@angular/common/http' => 'ng.common.http' 15 | * - '@angular/platform-browser-dynamic' => 'ng.platformBrowserDynamic' 16 | * - '@angular/platform-browser' => 'ng.platformBrowser' 17 | * - '@angular/platform-browser/animations' => 'ng.platformBrowser.animations' 18 | * - '@angular/platform-server' => 'ng.platformServer' 19 | * - '@angular/router' => 'ng.router' 20 | * 21 | * RxJS dependencies 22 | * Each RxJS functionality that you use in the library must be added as external dependency. 23 | * - For main classes use 'Rx': 24 | * e.g. import { Observable } from 'rxjs/Observable'; => 'rxjs/Observable': 'Rx' 25 | * - For observable methods use 'Rx.Observable': 26 | * e.g. import 'rxjs/add/observable/merge'; => 'rxjs/add/observable/merge': 'Rx.Observable' 27 | * or for lettable operators: 28 | * e.g. import { merge } from 'rxjs/observable/merge'; => 'rxjs/observable/merge': 'Rx.Observable' 29 | * - For operators use 'Rx.Observable.prototype': 30 | * e.g. import 'rxjs/add/operator/map'; => 'rxjs/add/operator/map': 'Rx.Observable.prototype' 31 | * or for lettable operators: 32 | * e.g. import { map } from 'rxjs/operators'; => 'rxjs/operators': 'Rx.Observable.prototype' 33 | * 34 | * Other dependencies 35 | * - Angular libraries: refer to their global namespace 36 | * - TypeScript/JavaScript libraries: 37 | * e.g. lodash: 'lodash' => 'lodash' 38 | * 39 | * Also, if the dependency uses CommonJS modules, such as lodash, 40 | * you should also use a plugin like rollup-plugin-commonjs, 41 | * to explicitly specify unresolvable "named exports". 42 | * 43 | */ 44 | const globals = { 45 | '@angular/core': 'ng.core', 46 | '@angular/common': 'ng.common', 47 | 'rxjs/Observable': 'Rx', 48 | 'rxjs/Observer': 'Rx' 49 | }; 50 | 51 | export default { 52 | external: Object.keys(globals), 53 | plugins: [resolve(), sourcemaps()], 54 | onwarn: () => { return }, 55 | output: { 56 | format: 'umd', 57 | name: 'ng.angularLibraryStarter', 58 | globals: globals, 59 | sourcemap: true, 60 | exports: 'named', 61 | amd: { id: 'ng2-cache' } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng2-cache", 3 | "version": "0.2.1", 4 | "description": "Client side caching for Angular5", 5 | "main": "./bundles/ng2-cache.umd.js", 6 | "module": "./esm5/ng2-cache.js", 7 | "es2015": "./esm2015/ng2-cache.js", 8 | "scripts": { 9 | "build": "node build.js", 10 | "pack:lib": "npm run build && npm pack ./dist", 11 | "publish:lib": "npm run build && npm publish ./dist", 12 | "publish:lib:next": "npm run build && npm publish --tag next ./dist", 13 | "compodoc": "compodoc -p tsconfig.json", 14 | "compodoc:serve": "compodoc -s" 15 | }, 16 | "typings": "./ng2-cache.d.ts", 17 | "author": "", 18 | "contributors": [ 19 | { 20 | "name": "Jackson88", 21 | "url": "https://github.com/Jackson88/" 22 | }, 23 | { 24 | "name": "Paritosh Patel", 25 | "email": "13868399+paritosh64ce@users.noreply.github.com", 26 | "url": "https://simplyfyingtechblog.wordpress.com" 27 | } 28 | ], 29 | "repository": { 30 | "type": "git", 31 | "url": "git+ssh://git@github.com:Jackson88/ng2-cache.git" 32 | }, 33 | "bugs": { 34 | "url": "https://github.com/Jackson88/ng2-cache/issues" 35 | }, 36 | "homepage": "https://github.com/Jackson88/ng2-cache", 37 | "keywords": [ 38 | "cache", 39 | "angular2", 40 | "angular5", 41 | "client-side", 42 | "caching" 43 | ], 44 | "license": "MIT", 45 | "dependencies": { 46 | "tslib": "^1.7.1" 47 | }, 48 | "peerDependencies": { 49 | "@angular/common": ">= 5.0.0", 50 | "@angular/core": ">= 5.0.0" 51 | }, 52 | "devDependencies": { 53 | "@angular/animations": "5.0.0", 54 | "@angular/common": "5.0.0", 55 | "@angular/compiler": "5.0.0", 56 | "@angular/compiler-cli": "5.0.0", 57 | "@angular/core": "5.0.0", 58 | "@angular/platform-browser": "5.0.0", 59 | "@angular/platform-browser-dynamic": "5.0.0", 60 | "@angular/platform-server": "5.0.0", 61 | "@compodoc/compodoc": "1.0.3", 62 | "@types/jasmine": "2.6.2", 63 | "@types/node": "8.0.47", 64 | "chalk": "2.3.0", 65 | "codelyzer": "4.0.2", 66 | "core-js": "2.5.1", 67 | "istanbul-instrumenter-loader": "3.0.0", 68 | "jasmine-core": "2.8.0", 69 | "karma": "1.7.1", 70 | "karma-chrome-launcher": "2.2.0", 71 | "karma-coverage-istanbul-reporter": "1.3.0", 72 | "karma-jasmine": "1.1.0", 73 | "karma-sourcemap-loader": "0.3.7", 74 | "karma-spec-reporter": "0.0.31", 75 | "karma-webpack": "2.0.5", 76 | "reflect-metadata": "0.1.10", 77 | "rollup": "0.50.0", 78 | "rollup-plugin-license": "0.6.0", 79 | "rollup-plugin-node-resolve": "3.0.0", 80 | "rollup-plugin-sourcemaps": "0.4.2", 81 | "rxjs": "5.5.2", 82 | "shelljs": "0.7.8", 83 | "source-map-loader": "0.2.3", 84 | "ts-loader": "3.1.1", 85 | "tslint": "5.8.0", 86 | "tslint-angular": "1.0.0", 87 | "typescript": "2.4.2", 88 | "uglify-js": "3.1.6", 89 | "webpack": "3.8.1", 90 | "zone.js": "0.8.18" 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## ng2-cache library Changelog 2 | 3 | 4 | ### 0.2.0 5 | 6 | ## What changed 7 | 8 | - Used [angular-library-starter](https://github.com/robisim74/angular-library-starter/) as base. 9 | - Removed test cases related files from the base. 10 | - Code comment updated at some places to avoid `tslint` errors. No implementation code is updated. 11 | - To build, simple run `npm run publish:lib`. Files will be generated inside `/dist` folder as per `Angular Package` standard. 12 | - To consume `ng2-cache`, nothing changes. Removed the need to import `ng2-cache` inside `tsconfig.json` 13 | 14 | 15 | 16 | 17 | ### 0.1.12 18 | 19 | ## What changed 20 | 21 | The library is created as separate Angular module. 22 | 23 | After installing `npm install ng2-cache --save` 24 | 25 | 1. Import it in your main app module 26 | ``` 27 | @NgModule({ 28 | declarations: [ 29 | .... 30 | ], 31 | imports: [ 32 | .... 33 | Ng2CacheModule 34 | ], 35 | providers: [], 36 | bootstrap: [AppComponent] 37 | }) 38 | export class AppModule { } 39 | ``` 40 | 41 | 2. Use it inside your `Component` by DI 42 | 43 | ```` 44 | ... 45 | import { CacheService, CacheStoragesEnum } from 'ng2-cache'; 46 | ... 47 | 48 | export class AppComponent { 49 | 50 | constructor(private _cacheService: CacheService) { 51 | this._cacheService.set('key', ['some data']); 52 | } 53 | ```` 54 | 55 | 3. You might need to import it in yout tsconfig.json file 56 | 57 | ```` 58 | "include": [ 59 | "src/**/*", 60 | "node_modules/ng2-cache" 61 | ] 62 | ```` 63 | You'll need to import the same way in your tsconfig.spec.json if you are running test cases with karma/jasmine. 64 | 65 | 66 | # 0.1.11 67 | 68 | ## ng2-cache 69 | 70 | Client side caching service for Angular2 71 | 72 | ## Installation 73 | 74 | To install this library, run: 75 | 76 | ```bash 77 | $ npm install ng2-cache --save 78 | ``` 79 | 80 | Usage: 81 | 82 | ```typescript 83 | 84 | import {Component} from '@angular/core'; 85 | import {CacheService, CacheStoragesEnum} from 'ng2-cache/ng2-cache'; 86 | 87 | declare var BUILD_VERSION: string; 88 | 89 | @Component({ 90 | selector: 'some-selector', 91 | template: '