如何在我的项目中使用Bower软件包组件 [英] How to use a bower package component into my project
问题描述
我正在使用角材料设计进行均质堆叠应用.我被困在使用"md-datepicker".我正在设计一个具有出生日期"字段的表单,但是md-datepicker不允许选择年份.我找到了一个打包机" https://github.com/alenaksu/mdPickers ",我试图将其添加到我的项目中.
I am working on a mean stack application using angular material design. I got stuck on using 'md-datepicker'. I was designing a form which is having an Date of birth field but md-datepicker dont allow to select the year. I found a bower packer "https://github.com/alenaksu/mdPickers" and I was trying to add it into my project.
- 我安装了凉亭
- I installed the bower
npm安装凉亭
npm install bower
安装mdpackages
bower install mdpackages
完成此步骤后,我在项目目录中找到了bower-components.所以我的问题是我应该在哪里链接此组件. (我真的是中庸之辈).现在我不知道如何在我的项目中使用它. mdpicker-bower软件包的Dir图片
after this steps I got the bower-components in my project directory. So my question is where should i link this components. (I am really new in the mean stack). Now I dont know how to use it in my project. image of the Dir of mdpicker-bower package
我知道这个问题有点令人困惑,但是如果有人可以帮助我,我将向团队精神开放.预先感谢.
I know the question is little bit confusing, but if some one can help me i am will open to teamviwer. Thanks in advance.
推荐答案
在实例化根应用程序模块的位置,将mdPickers
作为依赖项附加.例如
Where you instantiate your root application module, append mdPickers
as a dependency. Such as,
angular.module("app", [
"mdPickers"
]);
然后在您的控制器中实例化要使用的组件.
In your controller, you then instantiate the component you want to use.
angular.module("app").controller("MainCtrl", ['$scope', '$mdpDatePicker', function($scope, $mdpDatePicker) {
// do something with $mdpDatePicker
}]);
您可以在此处找到更完整的示例.
You can find more complete examples of how to use the module here.
这篇关于如何在我的项目中使用Bower软件包组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!