Skip to content

Commit

Permalink
fix: fixed bug with attribute "items"
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyTheTank committed Nov 27, 2015
1 parent 77ca734 commit 24d7441
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@

<aping
template-url="../bower_components/apiNG-design-default/dist/aping_design_default.html"
items="6"
type="social"
aping-youtube="[{'search':'sunset'}]"
aping-youtube="[{'search':'sunset', 'items':3 }]"
aping-instagram="[{'tag':'cakephp'}]"
aping-facebook="[{'page':'namikamusik'}]"
aping-codebird="[{'search':'ocean', 'result_type':'popular'}]">
Expand Down
4 changes: 2 additions & 2 deletions dist/aping.min.js

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

8 changes: 6 additions & 2 deletions src/aping-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ apingApp.service('apingTimeHelper', function () {
};
})
.service('apingUtilityHelper', ['apingInputObjects', function (apingInputObjects) {
this.parseJsonFromAttributes = function (_string, _platform) {
this.parseJsonFromAttributes = function (_string, _platform, _appSettings) {

if (!(typeof _string === "string" && _string)) {
return [];
}
Expand All @@ -61,13 +62,16 @@ apingApp.service('apingTimeHelper', function () {
angular.forEach(tempArray, function (value, key) {

value.platform = _platform;
if(typeof value.items == "undefined" && _appSettings && typeof _appSettings.items != "undefined") {
value.items = _appSettings.items;
}


var request = apingInputObjects.getNew("request", value);
requests.push(request);

});


return requests;
};

Expand Down

0 comments on commit 24d7441

Please sign in to comment.