问题
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 install bower
- Install package,
bower install mdpackages
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.
回答1:
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.
来源:https://stackoverflow.com/questions/37441892/how-to-use-a-bower-package-component-into-my-project