2020-12-10 10:11:18 +00:00
|
|
|
{
|
|
|
|
"[Moodle] Service Singleton": {
|
|
|
|
"scope": "typescript",
|
|
|
|
"prefix": "massingleton",
|
|
|
|
"body": [
|
|
|
|
"import { Injectable } from '@angular/core';",
|
|
|
|
"import { makeSingleton } from '@singletons';",
|
|
|
|
"",
|
2021-01-14 11:40:03 +00:00
|
|
|
"/**",
|
|
|
|
" * $2.",
|
|
|
|
" */",
|
2020-12-10 10:11:18 +00:00
|
|
|
"@Injectable({ providedIn: 'root' })",
|
|
|
|
"export class ${1:${TM_FILENAME_BASE}}Service {",
|
|
|
|
"",
|
|
|
|
" $0",
|
|
|
|
"",
|
|
|
|
"}",
|
|
|
|
"",
|
|
|
|
"export class ${1:${TM_FILENAME_BASE}} extends makeSingleton(${1:${TM_FILENAME_BASE}}Service) {}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"description": "[Moodle] Create a Service Singleton"
|
2021-01-14 11:40:03 +00:00
|
|
|
},
|
|
|
|
"[Moodle] Singleton": {
|
|
|
|
"scope": "typescript",
|
|
|
|
"prefix": "masingleton",
|
|
|
|
"body": [
|
|
|
|
"/**",
|
|
|
|
" * Singleton$2.",
|
|
|
|
" */",
|
|
|
|
"export class ${1:${TM_FILENAME_BASE}} {",
|
|
|
|
"",
|
|
|
|
" $0",
|
|
|
|
"",
|
|
|
|
"}",
|
|
|
|
""
|
|
|
|
],
|
|
|
|
"description": "[Moodle] Create a Pure Singleton"
|
2020-12-10 10:11:18 +00:00
|
|
|
}
|
|
|
|
}
|