Skip to content

Commit

Permalink
[Version - v0.3.3]
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaygopinath committed Feb 16, 2016
1 parent 74618df commit 22eca98
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#Changelog

## [v0.3.3](https://github.com/vinaygopinath/ngMeta/releases/tag/v0.3.3)

##### Features
* An error is shown when `ngMeta.setTitle()` or `ngMeta.setTag()` is used without initializing ngMeta in the run phase using `ngMeta.init()`

## [v0.3.2](https://github.com/vinaygopinath/ngMeta/releases/tag/v0.3.2)

##### Features
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngMeta",
"version": "0.3.2",
"version": "0.3.3",
"authors": [
"Vinay Gopinath <[email protected]>"
],
Expand Down
6 changes: 6 additions & 0 deletions dist/ngMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
* ngMeta.setTitle('Page name');
*/
var setTitle = function(title, titleSuffix) {
if (!$rootScope.ngMeta) {
throw new Error('Cannot call setTitle when ngMeta is undefined. Did you forget to call ngMeta.init() in the run block? \nRefer: https://github.com/vinaygopinath/ngMeta#getting-started');
}
$rootScope.ngMeta.title = angular.isDefined(title) ? title : defaults.title;
if (config.useTitleSuffix) {
$rootScope.ngMeta.title += angular.isDefined(titleSuffix) ? titleSuffix : defaults.titleSuffix;
Expand All @@ -72,6 +75,9 @@
* ngMeta.setTag('og:image', 'http://example.com/a.png');
*/
var setTag = function(tag, value) {
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');
}
$rootScope.ngMeta[tag] = angular.isDefined(value) ? value : defaults[tag];
};

Expand Down
4 changes: 2 additions & 2 deletions dist/ngMeta.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-meta",
"version": "0.3.2",
"version": "0.3.3",
"description": "Meta tags support for AngularJS single page applications (SPA)",
"main": "src/ngMeta.js",
"directories": {
Expand Down

0 comments on commit 22eca98

Please sign in to comment.