Merge pull request #2795 from IdeaBlade/chalin-util-js-getExampleName-1114

chore(util.js): getExampleName - support optional .html suffix
This commit is contained in:
Ward Bell 2016-11-14 09:33:55 -08:00 committed by GitHub
commit 78e25840b2
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ var NgIoUtil = (function () {
// TODO: use $location.path() instead(?). It seems to be empty.
var loc = $location.absUrl();
// E.g., https://example.com/docs/dart/latest/guide/displaying-data.html
var matches = loc.match(/.*\/([\w\.\-]+)\.html/);
var matches = loc.match(/.*\/([\w\-]+)(\.html)?$/);
if (matches) NgIoUtil.setExampleName(matches[1]); // cache name
}
return NgIoUtil._exampleName;