我正在把我的第一个有角度的网站放在一起,并决定在我深入研究之前尝试使用自耕农可能是最好的。我无法弄清楚如何让一切都协同工作。
我用自耕农创建了一个应用程序,当提示时,这里是我选择的选项:
yo angular myapp
Would you like to use Sass (with Compass)? (Y/n) y
Would you like to include Bootstrap? (Y/n) y
Would you like to use the Sass version of Bootstrap? (Y/n) y
? Which modules would you like to include? (Press <space> to select)
>(*) angular-animate.js
( ) angular-aria.js
(*) angular-cookies.js
(*) angular-resource.js
( ) angular-messages.js
(*) angular-route.js
(*) angular-sanitize.js
(*) angular-touch.js
此时我有一个正常运作的网站。
然后我使用凉亭安装了ui-grid,这是我遇到问题的地方。
bower install angular-ui-grid#3.0.0-RC.18
bower angular-ui-grid#3.0.0-RC.18 cached git://github.com/angular-ui/bower-ui-grid.git#3.0.0-RC.18
bower angular-ui-grid#3.0.0-RC.18 validate 3.0.0-RC.18 against git://github.com/angular-ui/bower-ui-grid.git#3.0.0-RC.18
bower angular-ui-grid#3.0.0-RC.18 cached git://github.com/angular-ui/bower-ui-grid.git#3.0.0-RC.18
bower angular-ui-grid#3.0.0-RC.18 validate 3.0.0-RC.18 against git://github.com/angular-ui/bower-ui-grid.git#3.0.0-RC.18
bower angular#^1.3.0 cached git://github.com/angular/bower-angular.git#1.3.8
bower angular#^1.3.0 validate 1.3.8 against git://github.com/angular/bower-angular.git#^1.3.0
bower angular#1.3.8 cached git://github.com/angular/bower-angular.git#1.3.8
bower angular#1.3.8 validate 1.3.8 against git://github.com/angular/bower-angular.git#1.3.8
bower angular-ui-grid#3.0.0-RC.18 install angular-ui-grid#3.0.0-RC.18
bower angular#^1.3.0 install angular#1.3.8
bower angular#~1.2.16 cached git://github.com/angular/bower-angular.git#1.2.28
bower angular#~1.2.16 validate 1.2.28 against git://github.com/angular/bower-angular.git#~1.2.16
Unable to find a suitable version for angular, please choose one:
1) angular#~1.2.16 which resolved to 1.2.28 and is required by angular-ui-grid#3.0.0-RC.18
2) angular#^1.3.0 which resolved to 1.3.8 and is required by officemanager
3) angular#1.3.8 which resolved to 1.3.8 and is required by angular-animate#1.3.8Prefix the choice with ! to persist it to bower.json
? Answer::
angular-ui-grid#3.0.0-RC.18 bower_components\angular-ui-grid
└── angular#1.3.8
这是我迷路的地方。 yeoman安装了似乎是更新版本的角度,但是ui-grid似乎需要#3中模块不支持的版本。
我尝试了选项#1,网站无法正常工作,因为#3中的脚本失败了。 我尝试了选项#2 /#3和网站工作,但无法加载网格。
我最初在自耕农之外创建了一个项目,直到我意识到使用这样的工具可能很有价值。
任何帮助都会非常感激!
这是我的bower.json
{
"name": "officemanager",
"version": "0.0.0",
"dependencies": {
"angular": "^1.2.16",
"json3": "^3.3.0",
"es5-shim": "^4.0.0",
"bootstrap": "^3.2.0",
"angular-animate": "^1.2.16",
"angular-cookies": "^1.2.16",
"angular-resource": "^1.2.16",
"angular-route": "^1.2.16",
"angular-sanitize": "^1.2.16",
"angular-touch": "^1.2.16",
"angular-ui-grid": "3.0.0-RC.18"
},
"devDependencies": {
"angular-mocks": "~1.2.16",
"angular-scenario": "~1.2.16"
},
"appPath": "app"
}
答案 0 :(得分:0)
我遇到了同样的错误,现在让它正常工作。我做了以下,但我不够精明,知道是否需要所有步骤。我正在传递它,以防它有所帮助,或者如果你找到了更好的方法并且可以让我知道。
Ran:bower安装angular-ui-grid,在尝试让它工作的混合中,我也做了:bower安装angular-ui-grid --save-dev。
手动更新了index.html(来自yeoman angular-fullstack脚手架应用程序),右侧(与凉亭相关)的地方有css(head)和js(body)文件,但是当我弹回grunt服务时它们已经消失了,所以我将这些线放在了凉亭维护区域之外 - 显然不是正确的解决方案。
从此页面下载最新版本候选版本的zip https://github.com/angular-ui/bower-ui-grid
将安装了bower的版本复制并替换为zip文件中下载的文件。
添加&#39; ui.grid&#39;到客户端app.js
将http://ui-grid.info/docs/#/tutorial/101_intro中的示例代码添加到新的yo-scaffolded路线中的相应文件中
热辣的狗 - 它终于奏效了!