Skip to content

Conversation

@amanrajs
Copy link
Owner

No description provided.

}
}
function setLeftContent(fullContainer,container){
let url = `https://newsapi.org/v2/top-headlines?country=in&apiKey=ac1fd7a9fc1342abb913e554a9525d85&pageSize=20`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move url to constant file

@@ -0,0 +1,17 @@
const defaultContent='Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
const defaultDescription='created at 21 July 2019""created at 21 July 2019';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use single const declaration

window.localStorage.setItem(emailid, JSON.stringify(emailid));
alert(emailSubscribedMessage);
}
else{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

popup.appendChild(descriptionPopup);
fullContainer.style.opacity = '0.3';
}
else if(clickEvent.srcElement.id === 'closePopup'){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

btn.heading=contentHead;
}
else{
btn.data=data.articles[index].description;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

})
.catch(function(error) {
});
fullContainer.appendChild(container);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt be this line inside the success?

.catch(function(error) {
});
fullContainer.appendChild(container);
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this assignment trainer asked to keep in header only

@@ -0,0 +1,41 @@
function setRightContent(article_data,fullContainer,container){
let rightContainer = document.createElement('div'),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

}
}
function setLeftContent(fullContainer,container){
let url = `https://newsapi.org/v2/top-headlines?country=in&apiKey=ac1fd7a9fc1342abb913e554a9525d85&pageSize=20`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

function changeContent(val,fullContainer,container){
let data=fullContainer.data;
let similar=0;
container.innerHTML = '';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

.catch(function(error) {
});
fullContainer.appendChild(container);
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this assignment trainer asked to keep in header only

@@ -0,0 +1,10 @@
function setLeftContent(fullContainer,container,newsUrl){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

@@ -0,0 +1,78 @@
function changeContent(container,fullContainer){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

@@ -0,0 +1,40 @@
function clicked(clickEvent,fullContainer,popup){
return clickEvent => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mnhaque
Copy link

mnhaque commented Aug 10, 2019

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants