Skip to content

Instantly share code, notes, and snippets.

@azirbel
Last active September 7, 2016 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azirbel/cb0da66860c0e213004c3be1aadc6529 to your computer and use it in GitHub Desktop.
Save azirbel/cb0da66860c0e213004c3be1aadc6529 to your computer and use it in GitHub Desktop.
// NOW
import angular from 'angular';
module.exports = angular.module('admin.components.od-document-table.od-admin-document-table', [
])
.component('odAdminDocumentTable', {
bindings: {
documentableId: '<',
documents: '=',
documentableType: '@',
flipId: '<',
readOnly: '<',
},
template: `
<od-document-table
documentable-id={{$ctrl.documentableId}}
documents={{$ctrl.documents}}
documentable-type={{$ctrl.documentableType}}
flip={{$ctrl.flipId}}
read-only={{$ctrl.readOnly}}
document-model={{$ctrl.Document}}
>
</od-document-table>
`,
controller: class {
constructor(Document) {
this.Document = Document;
}
}
})
.name;
// FUTURE - Once we have ResolveContainer
import angular from 'angular';
import ResolveContainer from 'common/hoc/resolve-container';
module.exports = angular.module('admin.components.od-document-table.od-admin-document-table', [
])
.component('odAdminDocumentTable', ResolveContainer('od-document-table', {
resolve: {
documentModel: (Document) => Document
}
})
.name;
module.exports = angular.module('tools.components.od-document-table.od-document-table', [
])
.component('odDocumentTable', {
bindings: {
documentableId: '<',
documents: '=',
documentableType: '@',
flipId: '<',
readOnly: '<',
documentModel: '<',
},
template: require('./od-document-table.jade')(),
controller: class {
// TODO weird that i have to explicitly inject this.
// will fix later.
// TODO(azirbel): Take it out now?
// @ngInject
constructor(Upload, S3, documentModel) {
this.searchQuery = '';
this.Upload = Upload;
this.S3 = S3;
this.documentModel = documentModel;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment