Search Posts

Category: mean-stack

POST 404 Error when deploying MEAN app on Heroku

I was recently following a tutorial on youtube that went over creating a MEAN application locally. I decided to try to deploy my version over heroku and run into the error when adding an item: POST https://bookstore-matt-vroom.herokuapp.com/api/books/ 404 (Not Found) as well as GET 503(Service unavailable) Possibly unhandled rejection:{} my server.js file is: let express = require(‘express’); let app = express(); let bodyParser = require(‘body-parser’); let mongoose = require(‘mongoose’); let mongodb = require(“mongodb”); let ObjectID […]

ngRepeat:dupes when trying to fetch from database

I am constantly getting the mentioned error no matter what I try. The error stops when I comment out the “fetchCourses()” in courses.js file. I am guessing the error is somewhere in the http request but I cannot figure it out. Here are my code snippets. courses.js (controller) var app = angular.module(“app”); app.controller(‘coursesCtrl’, [‘$scope’, ‘Courses’, ‘$routeParams’, function ($scope, Courses, $routeParams) { function fetchCourses() { Courses.getCourses({}).then(function (res) { $scope.courses = res.data; }, function (err) { console.log(err); […]

Hoe to get resource type object in MEAN stack

I am new in MEAN stack and also learning these technologies. Please help me to understand my issue. I was trying to add Enquiry Module in MEAN 0.6.0 boiler plate stack. I am able to create view/controller/menu/config and able to link Controller. But while making call to server side then time I am not able to connect it via resource API. Basically not able to call server side api from controller via service. My code […]

Not able to print data using Angular js 2

I’m not sure where I went wrong, created aMean Stack app both server side and client. Server side works fine I’m able post, get and delete data from Table, but not able to display get data in component.html file. I have shared my component, services and html files, please find what’s the error. If you need any another file I can share. This is ideas.component.html <div class=”container”> <div *ngFor=”let idea of ideas”> <div class=”col-md-3″> {{ideas.Name}} […]

Error setting up mean-stack environment

I’m looking into some very old MEAN-stack code with the aim of bringing it to compatibility with the current browser generation. Per the original developer’s documentation, the codebase is using a beta version of angular 2 along with angular 1.4, using a downgrade adapter to get these to work in harmony. I have followed the original developer’s instructions, installing node, bower and grunt. Then when attempting to use grunt to start WebStorm I am stuck […]

Lazy loading on scrolling drop down options in angularjs

I am working on MEAN stack application in which I am defining a drop down using following customize directive. This drop down shows available variables from an array(around 70K options). .directive(‘inputDropdown’, function($parse) { var template = ‘<input class=”form-control” ng-model=”ngModel” ng-disabled=”disabled” ng-focus=”setDirectiveList()” ng-blur=”removeDirectiveList()”>’ + ‘<div class=”dropdown dropdown1″ input-dropdown=”increaseLimit()” ng-init=”limit=20;” ng-click=”setDirectiveList()”>’ + ‘<div class=”form-control” ng-repeat=”value in selectedList | filter:ngModel | limitTo:limit”>’ + ‘<div ng-mousedown=”select($event, value)”>{{value}}</div>’ + ‘</div>’ + ‘</div>’; return { restrict: ‘EA’, require: ‘^form’, scope: { […]

Opening a different tab on button click and redirecting to another html

I know there are similar questions, but the answers and suggestions are not working for me and i am unable to understand the error. On click of a button, I want to load another HTML in a new tab. When I try, “www.google.com”, I am able to do so. But when I try to load an HTML which I have, I am unable to do so. Here is the relevant html code : <div id=”button”> […]

Next Page »