* Move to webpack build * Use webpack for building openmct. Move SCSS to one folder and load all core css up front. Remove bower, begin removing gulp in favor of npm run. * Uses eslint instead of jshint and jscs. Merge style checking rules into .eshintrc.js, carrying over core parts of crockford style and our adaptations. Current code base fails to pass the linter, want to separate linter changes from fixes to linting rules. * Support for Vue SFC with example * Remove outdated examples * Use HTML loader for html (supports relative imports of resources e.g. images) and raw-loader for when javascript must be loaded as text.
		
			
				
	
	
		
			31 lines
		
	
	
		
			765 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			765 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
define([
 | 
						|
    '../res/templates/mct-example.html'
 | 
						|
], function (
 | 
						|
    MCTExampleTemplate
 | 
						|
) {
 | 
						|
 | 
						|
    function MCTExample() {
 | 
						|
        function link($scope, $element, $attrs, controller, $transclude) {
 | 
						|
            var codeEl = $element.find('pre');
 | 
						|
            var exampleEl = $element.find('div');
 | 
						|
 | 
						|
            $transclude(function (clone) {
 | 
						|
                exampleEl.append(clone);
 | 
						|
                codeEl.text(exampleEl.html()
 | 
						|
                    .replace(/ class="ng-scope"/g, "")
 | 
						|
                    .replace(/ ng-scope"/g, '"'));
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
        return {
 | 
						|
            restrict: "E",
 | 
						|
            template: MCTExampleTemplate,
 | 
						|
            transclude: true,
 | 
						|
            link: link,
 | 
						|
            replace: true
 | 
						|
        };
 | 
						|
    }
 | 
						|
 | 
						|
    return MCTExample;
 | 
						|
});
 |