Skip to content

Commit

Permalink
support for demos in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Dec 9, 2018
1 parent d84003d commit 544f360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/demo-view/view/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const DECLARATIONS_REGEXP = /declarations: \[\:?(?:[\s]+)?([\w]+)(?:[\s]+)?\]/;
const SELECTOR_REGEXP = /selector: \'([\w-]+)\'/;
const SELECTOR_APP = 'root-app';

const HOST_DEV = 'http://localhost:1212/';
const HOST_PROD = `https://raw.githubusercontent.com/A-l-y-l-e/Alyle-UI/${AUI_VERSION}/src/app/`;
const styles = {
root: {
position: 'relative',
Expand Down Expand Up @@ -97,7 +99,7 @@ export class ViewComponent implements OnInit {

url(index: number) {
const fileName = this.path.split('/').reverse()[0];
const host = `https://raw.githubusercontent.com/A-l-y-l-e/Alyle-UI/${AUI_VERSION}/src/app/${this.path}`;
const host = `${isDevMode() ? HOST_DEV : HOST_PROD}${this.path}`;
const file = this.files[index];
return `${host}/${fileName}.${file.type}.${file.ext}`;
}
Expand Down

0 comments on commit 544f360

Please sign in to comment.