【发布时间】:2017-12-30 15:55:44
【问题描述】:
我目前正在尝试将 npm 模块集成到基于 Angularjs 1.4、Grunt 和 Bower 构建的应用程序中。
Require 和 Import 在 angualrjs 框架中不起作用,这是我能想到的访问 node_modules 文件夹的唯一方法。
有人知道如何在同一个应用程序中同时使用 npm 和 bower 模块吗?
这是我的 app.js 文件夹的精简版:
(function(angular) {
'use strict';
angular
.module('AppApp', [dependencies])
.constant('appconfig',{})
.config(function(...){
$statprovider.state{...}
.run(function($state){
$state.go('login);
})
})(angular);
我目前通过 bower 获取所有依赖项并通过 index.html 文件访问。如果我在那里编写一个链接到 node_modules 文件夹的脚本标记,这似乎不起作用。
【问题讨论】:
标签: javascript angularjs npm gruntjs bower