저는 응용 프로그램을 만들려고합니다. 예를 들어 아코디언과 datepicker를 사용하려면 bootstrap UI를 사용하고 있습니다. 그러나 ng-route 모듈을 통해 라우팅을 추가하려고하면 ui 파트가 작동을 멈 춥니 다.각도 : Ui 부트 스트랩을 사용하는 동안 라우팅
다음 angular tutorial에서var myApp= angular.module('myApp', ['ui.bootstrap']);
그들은 내가이 같은 NG-응용 프로그램 정의를 넣어야 할 라우팅 일을 사용하는 말을 다음과 같이 라우팅 부분없이
내 NG-응용 프로그램의 정의는 본다
var myApp = angular.module('myApp', [
'ngRoute',
'Controllers',
'ui.bootstrap'
]);
아니면 :
var myApp= angular.module('myApp', [
'ngRoute',
'Controllers'
]);
는 그래서는 다음과 같이한다 결합 내가 틀렸어? 이런 식으로 작동하지 않습니다.
은 index.html을 파일은 다음과 같습니다 :
!DOCTYPE html>
<html ng-app='myApp'>
<head>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-route.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers2.js"></script>
<script src="ui-bootstrap-tpls-0.9.0.js"></script>
<link rel="stylesheet" href="css/bootstrap-3.1.1-dist/css/bootstrap.css">
<link rel="stylesheet" href="css/app.css">>
</head>
<body>
<div ng-view></div>
</body>
</html>
controllers2.js 아직 어떤 컨트롤러를 정의하지 않습니다
var Controllers= angular.module('Controllers', []);
Controllers.controller('firstCtrl', ['$scope', '$http','$routeParams',
function ($scope, $http) {
}]);
Controllers.controller('secondCtrl', ['$scope', '$routeParams',
function($scope, $routeParams) {
}]);
app.js가 처리하는 라우팅 부분 :
var myApp = angular.module('myApp', [
'ngRoute',
'Controllers',
'ui.bootstrap'
]);
myApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/first', {
templateUrl: 'first.html',
controller: 'firstCtrl'
}).
when('/second', {
templateUrl: 'second.html',
controller: 'secondCtrl'
}).
otherwise({
redirectTo: '/first'
});
}]);
을
first.html 및 second.html은 많이 수행하지 않습니다. first.html :
<h1>first</h1>
<a href="#/second">second</a>
<accordion close-others="oneAtATime">
<accordion-group heading="Heading 1" is-open="true">
TSome Content
</accordion-group>
<accordion-group heading="Heading 2">
Some Content
</accordion-group>
</accordion>
second.html :
<h1>second</h1>
<a href="#/first">first</a>
first.html 작업 부트 스트랩으로, 다음과 같아야합니다
나는 몇 가지 코드 부분을 추가가 – dummkind