Skip to content

Instantly share code, notes, and snippets.

@mattkenefick
Created November 15, 2023 15:22
Show Gist options
  • Save mattkenefick/51fceb6f512b862f0a418389b779e2df to your computer and use it in GitHub Desktop.
Save mattkenefick/51fceb6f512b862f0a418389b779e2df to your computer and use it in GitHub Desktop.
Angular template
<section class="view-${input.filename}">
My Template
</section>
:host {
// Not implemented
}
${--
variables.capitalFilename = variables.input_filename.charAt(0).toUpperCase() + variables.input_filename.slice(1)
--}import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ${{ variables.capitalFilename }}Component } from './${input.filename}.component';
describe('${{ variables.capitalFilename }}Component', () => {
let component: ${{ variables.capitalFilename }}Component;
let fixture: ComponentFixture<${{ variables.capitalFilename }}Component>;
beforeEach(async () => {
await TestBed.configureTestingModule({ declarations: [${{ variables.capitalFilename }}Component] }).compileComponents();
fixture = TestBed.createComponent(${{ variables.capitalFilename }}Component);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
${--
variables.capitalFilename = variables.input_filename.charAt(0).toUpperCase() + variables.input_filename.slice(1)
--}import { Component, EventEmitter, Input, Output } from '@angular/core';
import ViewBase from '@/view/base';
/**
* @author ${package.author}
* @package ${{ outputDirectoryRelative.split('src/')[1] }}
* @project ${package.name}
*/
@Component({
host: { class: 'view view-${input.filename}' },
selector: 'view-${input.filename}',
styleUrls: ['./${input.filename}.component.scss'],
templateUrl: './${input.filename}.component.html',
})
export default class View${{ variables.capitalFilename }} extends ViewBase {
// Not implemented
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment