chore(util.js): getExampleName - support optional .html suffix
This commit is contained in:
parent
14db838f8b
commit
85062c47ca
|
@ -77,7 +77,7 @@ var NgIoUtil = (function () {
|
||||||
// TODO: use $location.path() instead(?). It seems to be empty.
|
// TODO: use $location.path() instead(?). It seems to be empty.
|
||||||
var loc = $location.absUrl();
|
var loc = $location.absUrl();
|
||||||
// E.g., https://example.com/docs/dart/latest/guide/displaying-data.html
|
// 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
|
if (matches) NgIoUtil.setExampleName(matches[1]); // cache name
|
||||||
}
|
}
|
||||||
return NgIoUtil._exampleName;
|
return NgIoUtil._exampleName;
|
||||||
|
|
Loading…
Reference in New Issue