gpt4 book ai didi

javascript - Angular 模拟与 Angular 模拟。有什么不同?

转载 作者:行者123 更新时间:2023-11-29 22:00:27 25 4
gpt4 key购买 nike

在这里 ( https://docs.angularjs.org/tutorial/step_07 ) 我读到:

{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "1.2.x",
"angular-mocks": "~1.2.x", <--- this
"bootstrap": "~3.1.1",
"angular-route": "~1.2.x"
}
}

在这里 ( https://docs.angularjs.org/api/ngMock ) 我读到:

First include angular-mock.js in your HTML:

<script src="angular.js">
<script src="angular-mock.js"> <--- this
  1. 什么是“angular-mock(s)”?
  2. 什么是正确的:“angular-mock”或“angular-mocks”?
  3. 两者有什么区别?

最佳答案

也许这是一个错误,正确的名称是angular-mockspackages.json 看起来像:

{
"name": "frontend",
"version": "0.0.1",
"dependencies": {
"jquery": "*",
"angular": ">=1.3.0-beta",
"angular-resource": ">=1.3.0-beta",
"angular-cookies": ">=1.3.0-beta",
"angular-sanitize": ">=1.3.0-beta",
},
"devDependencies": {
"angular-mocks": ">=1.3.0-beta",
"angular-scenario": ">=1.3.0-beta"
}
}

并包含在 karma.conf.js 中(在我的例子中,你有另一条路径):

'app/bower_components/angular-mocks/angular-mocks.js',

我在bower 中也找不到这样的包angular-mock。也许那是一个古老的名字。

关于javascript - Angular 模拟与 Angular 模拟。有什么不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24056998/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com