标尺服务不能作为本地依赖项 [英] Ruler service not working as local dependency
问题描述
我使用此插件将代码作为基础: http://plnkr.co/edit/81nWDyreYMzkunihfRgX? p =预览
I based my code using this plunker: http://plnkr.co/edit/81nWDyreYMzkunihfRgX?p=preview
如您所见,正在远程加载依赖项(带有http/s的脚本),然后我使用node更改它们,并用package.json和tsconfig.json本地替换所有依赖项.
As you can see is loading dependencies remotely (scripts with http/s), then I change them using node and replacing all dependencies locally with a package.json and tsconfig.json.
但是,当像这样将标尺和矩形依赖项更改为local时:
However, when changing the ruler and rectangle dependencies to local like this:
import {Ruler, Rectangle} from "angular2/src/platform/browser/ruler";
出现错误,提示:
"SyntaxError: expected expression, got '<'
Evaluating http://localhost:3000/angular2/src/platform/browser/ruler
Error loading http://localhost:3000/src/main.ts" angular2-polyfills.js:138:14
SyntaxError: expected expression, got '<'
推荐答案
https://github.com/angular/angular/pull/8452#issuecomment-220460761
mhevery评论了12天前 我们已决定删除标尺服务,因此它不属于公共API.
mhevery commented 12 days ago We have decided to remove Ruler service, and so it is not part of the public API.
这篇关于标尺服务不能作为本地依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!