-실현 각도를 사용하여 컨트롤러에서 모달를 열 않는 지시를 각도를-실현 :어떻게 내가 구체화의 CSS와 사용하고
http://materializecss.com/modals.html
http://krescruz.github.io/angular-materialize/#modals
을 나는 다음과 같은
을 위해 노력하고 있어요- 사용자 클릭 버튼
- 컨트롤러 동작이 중지되고 g 하는 API에서 등 데이터는
- 모달 사용자에게 표시되고 반환 된 데이터는 내가
<a href="#MyModal" modal class="my-modal-trigger waves-effect waves-green btn right"Show Data/a>
및 모달 내가
<div id="MyModal" class="modal"> <div class="modal-content center"> <div class="row"> <div class="row left"> <div class="card blue-grey darken-1"> <div class="card-content white-text"> <span class="card-title">Data</span> </div> <div> <ul class="collection"> //loop the data </ul> </div> </div> <a class="modal-action modal-close waves-effect waves-green btn">Close</a> </div> </div> </div> </div>
및 다음 버튼을 다음 한 한
표시됩니다 내 JS에
var app = angular.module("MyApp", ['ngRoute', 'ui.materialize']);
어떻게 내 컨트롤러
app.controller('mainController', function ($scope, $location, $http, AppConfig) {
var params = { some stuff}
$http({
method: 'POST',
url: myURL,
headers: {
'Content-Type': 'text/html',
'Accept': 'application/json'
},
params: params
})
.success(function (data) {
//pop up the modal and show the data
Materialize.toast('Awesome, we got the data', 4000);
})
.error(function (status) {
Materialize.toast('Bad stuff happened', 4000);
});
});