Search Posts

Category: mean

load mongo information to my own front-end table

how to load mongo information to my own front-end table I create my table with angular but whem i try i put the information here doesn’t appear and i don’t know why doesn’t have errors but the information but i can see the information and i read the information and the information appear. I put my code down with hope to some one can help me PD: sorry for my bad english. 😀 student-service.ts @Injectable() […]

How to use fileReader in angular js [duplicate]

This question already has an answer here: File Upload using AngularJS 26 answers ng-model for <input type=“file”/> 11 answers I have a function only for up function uploadBlogIamge(blogUrl, data, successMsg, errorMsg) { delete data.images; var file = document.querySelector(‘input[type=file]’).files[0]; var reader = new FileReader(); if (file) { data.imageName = reader.readAsDataURL(file); } Upload.upload({ url: $rootScope.server_url + blogUrl, //webAPI exposed to upload the file arrayKey: ”, data: data //pass file as data, should be user ng-model }).then(function (resp) […]

How to change the data in script tags in html from js?

I have the following script tag in my html, <script type=”application/ld+json”> { “@context”: “http://schema.org”, “@type”: “VideoObject”, “name”: “Title”, “description”: “Video description”, “thumbnailUrl”: [ “https://www.xpertdox.com/assets/images/XperDox_Cover_Art .png” ], “uploadDate”: “2015-02-05T08:00:00+08:00”, “duration”: “PT1M51S”, “embedUrl”: “https://www.youtube.com/watch?v=LDIYgpraBHA”, “interactionCount”: “2347” } </script> I want to append values to this through my js file,like “name”: “My Title”, “description”: “My description” But i dont know how to assign values to the script tag form js.I am using angular js.Can anyone please suggest me […]

How to add target="_blank" using replace operator in javascript?

How to replace all the occurrences of <a href=”http://localhost:4000/disease/description/{a random text}”></a> So here I want to add target=”_bank” to all the anchor tags which has the url ‘http://localhost:4000/disease/description/*’.I put start because it indicates a random text. I tried like this var text = data.replace(/ href=”http://localhost:4000/disease/description/*/g,’href=”http://localhost:4000/disease/description/* target=”_blank”‘); But this doesnt work.Can anyone please suggest me help.Thanks. Source: AngularJS

How to unset a field in Mongoose with findByIdAndUpdate [duplicate]

This question already has an answer here: Mongoose overwrite the document rather that `$set` fields 2 answers I use MEAN stack. On my backend I use findByIdAndUpdate function in Mongoose to do the update operation in CRUD. I also use Bootstrap UI date picker. On “clearing” of the date, uib-datepicker-popup resets the scope value for the date field to undefined. Now I pass the scope resource object into Mongoose with a HTTP PUT angular $resource […]