标尺服务无法作为本地依赖项工作 [英] Ruler service not working as local dependency
问题描述
我使用这个 plunker 基于我的代码: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.
但是,当像这样将标尺和矩形依赖项更改为本地时:
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 天前评论过我们决定移除 Ruler 服务,因此它不是公共 API 的一部分.
mhevery commented 12 days ago We have decided to remove Ruler service, and so it is not part of the public API.
这篇关于标尺服务无法作为本地依赖项工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!