我想知道如何设置我编码到我的" directive.js"中的离子HTML模板(newPopupTemplate)的样式。文件,我试图添加一个添加了CSS类,但它不起作用...理想情况下,我更喜欢用适当的CSS设置每个元素(标签,输入......等)的样式上课,这可能吗?
(以下代码有效,我刚删除了一些无用的部分以澄清:))
myApp.controller('MainCtrl', ['$scope', '$ionicPopup', '$timeout', function ($scope, $ionicPopup, $timeout) {
$scope.createPopUp = function(){
// I would like to style this template, is it possible to style each element with their proper CSS class ?
var newPopupTemplate = '<div class="top-input"><br><label>Date et heure</label><input type="datetime-local" ng-model="new.date"><br><label>Nombre de personne(s)</label><br><input type="number" min="1" max="100" maxlength="3" ng-model="new.nbPersonne"></div>'
var myPopup = $ionicPopup.show({
template: newPopupTemplate,
title: '',
subTitle: 'Please use normal things',
scope: $scope,
buttons: [
{ text: 'Annuler' },
{
text: '<b>Créer</b>',
type: 'button-positive',
}
}
}
]
});
};
}]);
&#13;
.center-form{
label{
background-color: rgba(255,255,255,0.7);
border-color: rgba(255,255,255,0);
&.top-input{
font-weight:300;
border-radius: 4px 4px 0px 0px !important;
}
&.bottom-input{
font-weight:300;
border-radius: 0px 0px 4px 4px !important;
}
}
.button-positive{
opacity:0.9;
}
}
&#13;
谢谢你们! :)