diff --git a/src/app/services/code-view/angular-code-service.ts b/src/app/services/code-view/angular-code-service.ts index 52b3296..aabc375 100644 --- a/src/app/services/code-view/angular-code-service.ts +++ b/src/app/services/code-view/angular-code-service.ts @@ -127,9 +127,6 @@ export class AngularCodeService extends CodeService { private getAngularGitHubSampleUrl(editor: string, sampleUrl: string, branch: string, demosBaseUrl: string) { const dvSample = this.isDvSample(demosBaseUrl, sampleUrl); - if (util.isLocalhost) { - branch = dvSample ? 'vnext' : 'vNext'; - } const repositoryPath = dvSample ? 'igniteui-angular-examples/tree/' : 'igniteui-live-editing-samples/tree/'; if (editor === "stackblitz") return `https://stackblitz.com/github/IgniteUI/${repositoryPath}${branch}/${sampleUrl}`; return `https://codesandbox.io/s/github/IgniteUI/${repositoryPath}${branch}/${sampleUrl}`; @@ -152,7 +149,9 @@ export class AngularCodeService extends CodeService { let demosBaseUrl = $codeView.attr(codeService.demosBaseUrlAttrName)!; let sampleFileUrl = codeService.getGitHubSampleUrl(demosBaseUrl, $codeView.attr(codeService.sampleUrlAttrName)!, $codeView.attr(codeService.githubSrc)!); let editor = $button.hasClass(codeService.stkbButtonClass) ? "stackblitz" : "codesandbox"; - let branch = demosBaseUrl.indexOf("staging.infragistics.com") !== -1 ? "vNext" : "master"; + const dvSample = this.isDvSample(demosBaseUrl, sampleFileUrl); + const stagingBranch = dvSample ? 'vnext' : 'vNext'; + let branch = demosBaseUrl.indexOf("staging.infragistics.com") !== -1 ? stagingBranch : "master"; window.open(codeService.getAngularGitHubSampleUrl(editor, sampleFileUrl, branch, demosBaseUrl), '_blank'); codeService.isButtonClickInProgress = false; }