Last active
September 7, 2016 23:17
-
-
Save azirbel/cb0da66860c0e213004c3be1aadc6529 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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