[Angularjs] how to use ‘angular-paginate-anything’ pagination module

Client-side Aangularjs Install: bower install angular-paginate-anything –save Angularjs: app.js angular.module(‘myModule’, [‘bgf.paginateAnything’]); blog.controller.js [js] class BlogCtrl { constructor(Auth, Blog, $state, $stateParams, $http, $scope, $location, socket) { this.errors = {}; this.success = {}; this.submitted = false; this.Auth = Auth; this.Blog = Blog; Read more ›

[bootstrap-markdown] show and hide markdown editor programmatically

html: [html] Edit [/html] Angularjs: [js] editComment(comment){ var self = this; var editor = angular.element($(`#${comment._id}`)); editor.markdown({autofocus: true, savable: true, hideable:true, onSave: function(e) {//e: markdown editor self.Blog.saveComment({ id:, comment_id: comment._id, content: e.getContent() }).$promise .then(() => { //angular.element($(‘.md-editor’)).children(‘.md-footer’).html(‘Comment is updated.’); var Read more ›

[mongoose] update and delete embedded document in array

Update: var comment =; = ‘Bruce Wayne’; (err) { // emmbeded comment with author updated }); Delete: Blog.findByIdAndUpdateAsync(blogId, { $pull: { comments: {_id: commentId}} }) .then(blog => { res.status(200).json(‘Comment is deleted successfully.’); }) .catch(err => { console.error(err); Read more ›

angular-fullstack generated code upgrade with Babel 6

Install  Babel 6 related packages: npm install –save-dev babel-register npm install –save-dev babel-plugin-add-module-exports npm uninstall –save-dev babel-core npm install –save-dev babel-core npm install babel-preset-es2015 Create .babelrc file: vi .babelrc { “presets”: [“es2015”], “plugins”: [“babel-plugin-add-module-exports”] } Chanage server/index.js file: vi server/index.js Read more ›

ECMAScript 6 Tutorial, Setting up Babel 6 – Babel compile it to run in current browser

현재의 브라우저는 ES6(ECMAScript 6) 자바스크립트를 지원하지 않는다. ES6 코드는 컴파일러(트랜스파일러)를 사용해 현재의 브라우저에서 돌아가는 코드로 변환해야 한다. 바벨(Babel)이 ES6 코드를 컴파일하는 사실상의 표준이 되었다. 아래 투토리얼은 Babel를 이용해 ES6 어플리케이션을 개발하고 실행하기 위한 개발환경을 설정해 본다. ** Babel 6 버전이 Read more ›