Skip to content

Commit

Permalink
[Core] - Error when setTag is called with title or titleSuffix tags
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaygopinath committed Mar 14, 2016
1 parent 44ae45f commit 1d2ff23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ngMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
if (!$rootScope.ngMeta) {
throw new Error('Cannot call setTag when ngMeta is undefined. Did you forget to call ngMeta.init() in the run block? \nRefer: https://github.com/vinaygopinath/ngMeta#getting-started');
}
if (tag === 'title' || tag === 'titleSuffix') {
throw new Error('Attempt to set \'' + tag + '\' through \'setTag\': \'title\' and \'titleSuffix\' are reserved tag names. Please use \'ngMeta.setTitle\' instead');
}
$rootScope.ngMeta[tag] = angular.isDefined(value) ? value : defaults[tag];
};

Expand Down

0 comments on commit 1d2ff23

Please sign in to comment.