chore(util.js): getExampleName - support optional .html suffix

This commit is contained in:
Patrice Chalin 2016-11-14 04:56:12 -08:00
parent 14db838f8b
commit 85062c47ca
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;