Bringing an External REST Feed into a Meteor Project

Scott ZischerkThis week with Meteor we attempted to bring in an external REST feed into the project. We were looking to bring the CodeMash session feed into the application. In order to do this, we needed to use import a Meteor package. We decided to use the http (https://atmospherejs.com/meteor/http ) package to do this since it was referenced in the Meteor documentation and looked to be the standard way to accomplish the task.

Continue reading “Bringing an External REST Feed into a Meteor Project”

A Tutorial in Meteor

8As I have been learning Meteor, I have found some great resources for the initial set up.

This is the official meteor tutorial– it’ll get you started with how to use Meteor. However there are a few things missing.

Unfortunately, this tutorial does not show you how to pass a parameter through a helper, which is incredibly important. The tutorial does not show you how, so I will!

Continue reading “A Tutorial in Meteor”

Meteor App for CodeMash Staff

Scott ZischerkWe are currently working on an application in meteor.js for CodeMash. The purpose of this application is to provide all members of the CodeMash crew (including staff, volunteers, admin, speakers, etc.) a way to stay in communication about CodeMash related information. The application will automatically create a list of the 40 users, give them a default password, and (after initial login) allow the user to change their information. The application will also include a messenger/chat feature to allow users to interact with each other.

As of last week, we created a user interface mockup. We have a functional login method, and a functional top navigation bar. We also have a page where admins can edit users. Today, we set up data retrieval for the “Schedule Admin” page. We tested to see what would show up if a user didn’t have permissions. During this test, we found out that the admin permissions were being cached. We will be fixing this in the next phase. We will also refine some of our requirements for the next steps.  

 

MongoDB for Custom Data Fields

Rick HerrmannWe have an application that contains a mix of relational data and dynamically structured data. All of the data is currently stored in SQL Server, with the dynamic portion of the data models being stored in string columns as json data. If all we needed to do with the non-relational data was to display it on various screens, SQL Server would work great.

Continue reading “MongoDB for Custom Data Fields”

Add a Slick Angular CSV Download Link

misc2Just thought I’d share this bit of code.  It allows an angular client app to create a csv file which can be used in a downloadable link that gets created on the client, on-the-fly, which the browser sees as an attachment:

// Create a downloadable link and click it.
$scope.SubmitFileToUser = function (csvData) {
var element = angular.element(‘<a/>’);
element.attr({
href: ‘data:attachment/csv;charset=utf-8,’ + encodeURI(csvData),
target: ‘_blank’,
download: ‘export.csv’
})[0].click();
};

Update: If this doesn’t work for you, Aydin Akcasu came up with an alternative way to do it here.

Javascript Testing with Jasmine

Rick HerrmannOne of the features I like about Jasmine is that the ability to mock objects and do interaction based testing is built into the tool.  When testing C# code (with NUnit, MSTest, or even NSpec) you have to pull in another tool to handle mocking.

In Jasmine, mock objects are called spies.  Accordingly, there is a built-in function called spyOn, which takes two parameters:

Continue reading “Javascript Testing with Jasmine”