gpt4 book ai didi

angularjs - 如何在我的 Angular JS 应用程序中正确设置 checklist-model 指令?

转载 作者:太空宇宙 更新时间:2023-11-04 00:27:10 24 4
gpt4 key购买 nike

我是一个 Node.js/grunt 世界的菜鸟,所以如果这个问题很愚蠢,我很抱歉......

我有一个与 yeoman/grunt 一起使用的 angular.js 项目,现在我想做的是包含一个指令,特别是 this one ,

但我不知道如何安装它!

我有:

-在命令提示符下使用命令 npm install checklist-model

-链接index.html文件中的脚本

<script src='node_modules/checklist-model/checklist-model.js'></script>

-并在我的应用程序中添加依赖项

var app = angular.module('generaPreventivoApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'checklist-model'
]);

控制台给我以下错误:

  Error: [$injector:modulerr] Failed to instantiate module app due to:
[$injector:modulerr] Failed to instantiate module checklist-model due to:
[$injector:nomod] Module 'checklist-model' is not available

如何正确设置?

最佳答案

我尝试使用 Bower 安装,所以:

bower 安装 list 模型 --save

我的凉亭更新了:

{
"name": "genera-preventivo",
"version": "0.0.0",
"dependencies": {
"angular": "^1.4.0",
"bootstrap-sass-official": "^3.2.0",
"angular-animate": "^1.4.0",
"angular-cookies": "^1.4.0",
"angular-resource": "^1.4.0",
"angular-route": "^1.4.0",
"angular-sanitize": "^1.4.0",
"checklist-model": "^0.11.0"
},
"devDependencies": {
"angular-mocks": "^1.4.0"
},
"appPath": "app",
"moduleName": "generaPreventivoApp",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
}
}

index.html

    <script src="bower_components/checklist-model/checklist-model.js"></script>

APP.js

var app = angular.module('generaPreventivoApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'checklist-model'

])

关于angularjs - 如何在我的 Angular JS 应用程序中正确设置 checklist-model 指令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42322240/

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