Skip to content

Instantly share code, notes, and snippets.

@nkbt
Created December 9, 2015 03:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nkbt/30dd58f9cecaec8a9557 to your computer and use it in GitHub Desktop.
Save nkbt/30dd58f9cecaec8a9557 to your computer and use it in GitHub Desktop.
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