Merge pull request #2795 from IdeaBlade/chalin-util-js-getExampleName-1114
chore(util.js): getExampleName - support optional .html suffix
This commit is contained in:
commit
78e25840b2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue