Commit 75cfb22c authored by Robert Knight's avatar Robert Knight

Convert `<svg-icon>` to a component

parent 67c59014
...@@ -152,6 +152,7 @@ module.exports = angular.module('h', [ ...@@ -152,6 +152,7 @@ module.exports = angular.module('h', [
.component('sidebarTutorial', require('./directive/sidebar-tutorial').component) .component('sidebarTutorial', require('./directive/sidebar-tutorial').component)
.component('shareDialog', require('./directive/share-dialog')) .component('shareDialog', require('./directive/share-dialog'))
.component('sortDropdown', require('./directive/sort-dropdown')) .component('sortDropdown', require('./directive/sort-dropdown'))
.component('svgIcon', require('./directive/svg-icon'))
.component('timestamp', require('./directive/timestamp')) .component('timestamp', require('./directive/timestamp'))
.directive('excerpt', require('./directive/excerpt').directive) .directive('excerpt', require('./directive/excerpt').directive)
...@@ -164,7 +165,6 @@ module.exports = angular.module('h', [ ...@@ -164,7 +165,6 @@ module.exports = angular.module('h', [
.directive('markdown', require('./directive/markdown')) .directive('markdown', require('./directive/markdown'))
.directive('spinner', require('./directive/spinner')) .directive('spinner', require('./directive/spinner'))
.directive('statusButton', require('./directive/status-button')) .directive('statusButton', require('./directive/status-button'))
.directive('svgIcon', require('./directive/svg-icon'))
.directive('tagEditor', require('./directive/tag-editor')) .directive('tagEditor', require('./directive/tag-editor'))
.directive('threadList', require('./directive/thread-list')) .directive('threadList', require('./directive/thread-list'))
.directive('topBar', require('./directive/top-bar')) .directive('topBar', require('./directive/top-bar'))
......
...@@ -21,15 +21,11 @@ function SvgIconController($element) { ...@@ -21,15 +21,11 @@ function SvgIconController($element) {
$element[0].innerHTML = icons[this.name]; $element[0].innerHTML = icons[this.name];
} }
module.exports = function () { module.exports = {
return { controllerAs: 'vm',
bindToController: true, controller: SvgIconController,
controllerAs: 'vm', bindings: {
restrict: 'E', /** The name of the icon to load. */
controller: SvgIconController, name: '<',
scope: { },
/** The name of the icon to load. */
name: '<',
},
};
}; };
...@@ -7,7 +7,7 @@ var util = require('./util'); ...@@ -7,7 +7,7 @@ var util = require('./util');
describe('svgIcon', function () { describe('svgIcon', function () {
before(function () { before(function () {
angular.module('app', []) angular.module('app', [])
.directive('svgIcon', require('../svg-icon')); .component('svgIcon', require('../svg-icon'));
}); });
beforeEach(function () { beforeEach(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment