Created
December 9, 2015 03:48
-
-
Save nkbt/30dd58f9cecaec8a9557 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
const React = require('react'); | |
const FeedsContainer = require('./FeedsContainer'); | |
const $inject = []; | |
const feeds = function () { | |
const link = ($scope, $element) => { | |
const node = $element.get(0); | |
$scope.$watch('feeds', f => | |
React.render(<FeedsContainer isLoading={!f.length} feeds={f} />, node)); | |
$scope.$on('$destroy', () => React.unmountComponentAtNode(node)); | |
}; | |
return { | |
scope: { | |
feeds: '=' | |
}, | |
restrict: 'E', | |
link: link | |
}; | |
}; | |
feeds.$inject = $inject; | |
module.exports = feeds; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment