Я следую за этой статьей https://medium.com/netscape/visualizing-data-with-angular-and-d3-209dde784aeb
Должна быть возможность привязать Angular @Directive к элементу svg: g, но я получаю ошибку, которую не могу исправить
HTML шаблон
<svg #svg class="container-fluid" height="600">
<g zoomable [zoomableFor]="svg">
<rect width="600" height="600" fill="#ecf0f1" />
...
1009 * zoomable.directive.ts *
@Directive({
selector: "[zoomable]"
})
export class ZoomableDirective implements OnInit {
@Input('zoomableFor') for: string;
Заранее спасибо.
compiler.js: 2547 Uncaught Ошибка: ошибки синтаксического анализа шаблона: не удается привязать к
'масштабируемый', поскольку он не является известным свойством ': svg: g'. ( "
] [zoomable] = "svg">
)
в JitCompiler.push ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents
(compiler.js: 24971)
на compiler.js: 24881
в Object.then (compiler.js: 2538)
в JitCompiler.push ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents
(compiler.js: 24880) syntaxError @ compiler.js: 2547
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse
@ compiler.js: 19495
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._parseTemplate
@ compiler.js: 25041
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileTemplate
@ compiler.js: 25028 (анонимно) @ compiler.js: 24971
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents
@ compiler.js: 24971 (анонимно) @ compiler.js: 24881, затем @
compiler.js: 2538
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents
@ compiler.js: 24880
нажмите ../ node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync
@ compiler.js: 24840
нажмите ../ node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync
@ platform-browser-dynamic.js: 143 compileNgModuleFactory__PRE_NGCC__ @
core.js: 14376
нажмите ../ node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule
@ core.js: 14559 ./src/main.ts @ main.ts: 11
webpack_require @ bootstrap: 78 0 @ main.ts: 12
webpack_require @ bootstrap: 78 checkDeferredModules @ bootstrap: 45 webpackJsonpCallback @ bootstrap: 32 (анонимно) @ main.js: 1
другие @Components как атрибуты на элементах svg.