我的第一個問題在這裏:)純CSS模式(::目標)具有角UI路由器
我移植我的網站角(我是新來的吧),並想知道如果我能在使用ui-router時保留我的純CSS模式對話框。在HTML它看起來像這樣:
<a id="footerMail" href="#openContact"></a>
<div id="openContact" class="modal">
<div class="modal__container">
<a href="#close" title="Close" class="modal__close">X</a>
<form class="contact-form" action="/" enctype="application/x-www-form-urlencoded" method="post">
</form>
</div>
它openContact ID使用::target
。但是當我在使用ui-router的時候試圖這樣做的時候,顯然,它不允許這個路徑發生,因爲它沒有被定義爲一個狀態。我應該如何定義它,因爲我不想重定向到一個新的URL,只需打開一個覆蓋當前狀態的模式?我的$ stateProvider看起來是這樣的:
$urlRouterProvider.otherwise("/site/editor");
$stateProvider
.state('site', {
url: "/site",
abstract: true,
templateUrl: "partials/site.html",
controller: 'MainController as ctrl'
})
.state('site.director', {
url: "/director",
templateUrl: "partials/gallery.html",
controller: 'GalleryController'
})
.state('site.editor', {
url: "/editor",
templateUrl: "partials/gallery.html",
controller: 'GalleryController'
});
});
鏈接和模態代碼會非常火,從主要的「現場」的狀態,因爲它是通用於所有子頁面或也許是太辛苦了,我應該重寫它,而不是使用。 CSS的方法呢?
提前感謝!