Skip to content

Commit

Permalink
Add Angular TS option
Browse files Browse the repository at this point in the history
  • Loading branch information
mapsandapps committed Jun 27, 2023
1 parent 7bb71b3 commit f04be20
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _templates/playground/new/angular.md.ejs.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# this file's location depends on whether or not the css option is selected via the prompt
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/${css ? 'angular/example_component_html.md' : 'angular.md'}` %>"
# this file's location depends on whether or not the css option or angular_ts option is selected via the prompt
to: "<%= `static/usage/v${version}/${name.replace('ion-', '')}/${path}/${(css || angular_ts) ? 'angular/example_component_html.md' : 'angular.md'}` %>"
---
```html
<<%= name %>></<%= name %>>
Expand Down
15 changes: 15 additions & 0 deletions _templates/playground/new/angular_example_component_ts.md.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# this file only gets generated if `angular_ts` (from the command line prompt) is true
to: "<%= angular_ts ? `static/usage/v${version}/${name.replace('ion-', '')}/${path}/angular/example_component_ts.md` : null %>"
---
```ts
import { Component } from '@angular/core';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',<% if (css){ %>
styleUrls: ['./example.component.css'],<% } %>
})
export class ExampleComponent {
}
```
7 changes: 7 additions & 0 deletions _templates/playground/new/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ module.exports = [
enabled: 'Yes',
disabled: 'No',
},
{
type: 'toggle',
name: 'angular_ts',
message: 'Generate an Angular TypeScript file?',
enabled: 'Yes',
disabled: 'No',
},
];

0 comments on commit f04be20

Please sign in to comment.