File: src/packages/blog/directives/blogViewDirective.js

Recommend this page to a friend!
  Classes of Alien Fernandez   Seed Sails Angular   src/packages/blog/directives/blogViewDirective.js   Download  
File: src/packages/blog/directives/blogViewDirective.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Seed Sails Angular
Full stack framework based on Sails, Node, Angular
Author: By
Last change: Update of src/packages/blog/directives/blogViewDirective.js
Date: 3 years ago
Size: 1,002 bytes
 

Contents

Class file image Download
import blogModule from '../blogModule'; import BlogView from '../react-components/blogViewReact'; /** * @ngdoc directive * @name BlogViewDirective * @author Alien Fernandez Fuentes <alienfernandez85@gmail.com> * @version 1.0.0 * * @description Directive article view * */ class BlogViewDirective { constructor() { let directive = { restrict: 'E', replace: true, //controller: DataViewController, template: '<div data-role="transclude"></div>', scope: { options: '=' }, link: ($scope, $element, $attrs, ngModel, transclude) => { //Render component with options React.render( React.createElement(BlogView, $scope.options), $element[0] ); } }; return directive; } } blogModule.directive('blogview', () => new BlogViewDirective()); export default blogModule;