CLI를 올바르게 실행하는 데 올바른 구성을 사용하면됩니다. 그러나 나는 이것을 반대 할 것이다. 모든 파일을 다운로드하면 각 파일의 최신 안정 버전을 가져옵니다. 이것은이 파일의 일부 패치에서 수정 된 잠재적 인 버그를 제거하는 데 도움이됩니다.
문제를 해결할 수있는 방법으로 대부분의 환경에서 사용할 수있을만큼 유연한 서비스/컨트롤러/지시문을 작성하십시오. 템플릿 서비스와 도우미 메서드를 만드는 것은 올바르게 코딩 된 경우 효율적일 수 있습니다.
예를 들어, 내 프로젝트의 경우 사용자에게 멋진 대화 상자를 제시 할 수있는 방법이 필요합니다. 이것은 꽤 보편적 인 기능입니다. 그래서 나는 그것을 위해 해낸 서비스를 썼습니다. 나는 모든 애플 리케이션에서 이것을 사용하며, 동일한 코드를 반복해서 재 작성할 필요가 없기 때문에 효율성이 높아진다. 파일을 내 디렉토리에 복사하고 참조하는 것입니다. 그래서
var module = angular.module('PopupModule', []);
module.service('PopupService', ['$ionicPopup', function ($ionicPopup) {
var factory = {};
factory.ConfirmDialog = function (title, contents, actionName) {
var data = {};
return $ionicPopup.prompt({
title: title,
inputType: 'input',
inputPlaceholder: contents
});
}
factory.MessageDialog = function (message) {
var alertPopup = $ionicPopup.alert({
title: 'Message',
template: message
});
};
factory.InitializeModal = function ($ionicModal, $scope, templateUrl) {
$ionicModal.fromTemplateUrl(templateUrl, {
scope: $scope,
animation: 'slide-in-up',
}).then(function (modal) {
$scope.modal = modal;
});
$scope.openModal = function() {
$scope.modal.show();
};
$scope.closeModal = function() {
$scope.modal.hide();
};
//Cleanup the modal when we're done with it!
$scope.$on('$destroy', function() {
$scope.modal.remove();
});
// Execute action on hide modal
$scope.$on('modal.hidden', function() {
// Execute action
});
// Execute action on remove modal
$scope.$on('modal.removed', function() {
// Execute action
});
};
return factory;
}]);
당신이 새 프로젝트를 만들 때 반복 필요한 모든 파일을 다운로드하라는됩니다
여기 내 예제? –