+ PageDocuments component

This commit is contained in:
tmshv committed 2016-02-25 19:04:52 +03:00
1 parent bbd4987359
commit c090f7d933
6 files changed
+32 -30

No files matched your search

+3 -7
View File
@@ -21,9 +21,9 @@ import PageSchedule from './components/PageSchedule';
import PageCollective from './components/PageCollective';
import PageGallery from './components/PageGallery';
import PageGalleryAlbum from './components/PageGalleryAlbum';
import PageDocuments from './components/PageDocuments';
import AppController from './controllers/AppController';
import DocumentsController from './controllers/DocumentsController';
import CopyrightController from './controllers/CopyrightController';
import ContactsController from './controllers/ContactsController';
@@ -95,6 +95,7 @@ app.run(($location, $rootScope, $http) => {
PageCollective,
PageGallery,
PageGalleryAlbum,
PageDocuments,
AppController,
DocumentsController,
CopyrightController,
@@ -104,10 +105,5 @@ app.run(($location, $rootScope, $http) => {
ScheduleSlider,
ScheduleSlide,
ScheduleRecord,
FooterLinks,
function (app) {
app.controller('DocumentsPageController', ($scope) => {
$scope.pageClass = 'page-documents';
});
}
FooterLinks
].map(i => i(app));
+17
View File
@@ -0,0 +1,17 @@
import template from '../../templates/components/page-documents.html';
export default function (app) {
app.component('pageDocuments', {
template: template,
controller: function(api, docs) {
this.pageClass = 'page-documents';
this.documents = docs.docs;
api.document.awards()
.success(data => {
this.awards = data;
});
}
});
};
+1 -2
View File
@@ -46,8 +46,7 @@ export let routes = [
},
{
name: '/documents',
templateUrl: '/views/documents.html',
controller: 'DocumentsPageController',
template: '<page-documents></page-documents>',
title: 'Документы'
}
];
@@ -1,10 +0,0 @@
export default function (app) {
app.controller('DocumentsController', ($scope, api, docs) => {
$scope.documents = docs.docs;
api.document.awards()
.success(data => {
$scope.awards = data;
});
});
};
@@ -0,0 +1,11 @@
<div class="content content_wide">
<h2>Устав, Лицензия, пр.</h2>
<div class="documents-container">
<document ng-repeat="i in $ctrl.documents" document="i"></document>
</div>
<h2>Награды</h2>
<div class="documents-container">
<award ng-repeat="i in $ctrl.awards" document="i"></award>
</div>
</div>
-11
View File
@@ -1,11 +0,0 @@
<div class="content content_wide" ng-controller="DocumentsController">
<h2>Устав, Лицензия, пр.</h2>
<div class="documents-container">
<document ng-repeat="i in documents" document="i"></document>
</div>
<h2>Награды</h2>
<div class="documents-container">
<award ng-repeat="i in awards" document="i"></award>
</div>
</div>