Profile

Cover photo
Ryan Zec
Works at OnForce
Attended Peabody Memorial Veterans High School
Lives in Woburn MA
73 followers|21,252 views
AboutPostsPhotosVideos

Stream

 
If anyone is looking to use #KoaJS with #AngularJS, I have a seed project here:

https://github.com/ryanzec/angular-koajs-seed

Remember that KoaJS is still early in development and you need NodeJS with generator support (preferably 0.11.9+).
1
Add a comment...

Ryan Zec

Discussion  - 
 
I was working with some form models and when I did this:

form[field].$setViewValue(modelValue);

It did not look like the view value changed, the page was still showing the old values.  I was then digging in the angular code and I saw something interesting so after the $setViewValue() line I added this line:

form[field].$render();

The form inputs updated their value.

If I call $setViewValue() do I always have to call $render() after it to get the input to update their values?  Is there some shortcut that I can use that executes both of them in one call?
1
Mike McElroy's profile photoPascal Precht's profile photo
3 comments
 
+1 on everything +Mike McElroy says. 
Add a comment...

Ryan Zec

Discussion  - 
 
With 1.2.0 a change to $compile has broken a few of my directives, any helper with this would be great : https://github.com/angular/angular.js/issues/4845
2
Johno Scott's profile photoRichard Vowles's profile photoRyan Zec's profile photo
3 comments
 
Breaking change in v1.2 - If you reference any fields in your model that begin with an underscore (e.g. customer._id) it will fail with an error like this

Error: [$parse:isecprv] Referencing private fields in Angular expressions is disallowed! Expression: customer._id

http://docs.angularjs.org/error/$parse:isecprv
Add a comment...

Ryan Zec

Question  - 
1
Jeff Schwartz's profile photo
 
Use setTimer to run your assertions. 
Add a comment...
In his circles
392 people
Have him in circles
73 people
Vanya Dineva's profile photo
shamail saidi's profile photo
Wesley Carr's profile photo
 
DalekJS And AngularJS

DalekJS is a relatively new cross-browser testing framework that allows you to test code directly in the browser.

Recently DalekJS added the ability to execute javascript within the browser and halt tests until the code returns true and this has opened up a much better integration option between DalekJS and AngularJS.

Before you would have to use a combination of waitForElement() and wait() actions in order to test AngularJS code with DalekJS and that can make tests slower than they need to be and sometimes flakey.  With the new functionality, it is now possible to hook into AngularJS's internals to know when AngularJS is finished doing stuff and I create this gist to show how:

https://gist.github.com/ryanzec/7546175

I would recommend the Chrome browser for running tests as it seems to be the most stable right now.

The plugin system for DalekJS is still under development so this is right now the easiest way to integrate the 2 however when the plugin system is implemented, I will be creating a plugin to streamline this even more to a simple waitForAngular() action.

I would consideration DalekJS an alternative to Karma for unit testing UI functionality (like directives, controllers, or anything dealing with DOM) however not an alternative for Karma testing lower level javascript code (non-DOM related services, filters, etc...).  The reason I like DalekJS for unit testing UI functionality instead of Karma is because I find it far easier to work with and I am at least working with where the final output is going to be.  The main benefit I see is that if a test fails, I have someplace to go in a browser and I can really play around with it to figure out what is going wrong.  If I had a failing test in a directive that I was using Karma to test, it might not be as easy to figure out why it is failing without being able to see what is happening which is not as easy with a Karma test.

Long term when DalekJS integrates with Selenium (which is on the roadmap somewhere), I would ideally be able to run my DalekJS tests against a mocked backend running against a NodeJS instance of the code as UI unit tests and then be able to run the same DalekJS tests against a Selenium server connecting to a real backend for integration tests but that is a ways down the road (however if you use Sauce Labs, DalekJS should have support for that right now).
4
2
Pascal Precht's profile photoShoaib Akhtar's profile photoSebastian Golasch's profile photo
 
Hey +Ryan Zec interesting insights!
Add a comment...

Ryan Zec

Discussion  - 
 
If anyone can help me in understanding whether or not this is a bug or how ngTransclude should be working in 1.2.0:

https://github.com/angular/angular.js/issues/4925
1
Ryan Zec's profile photoMark Titorenko's profile photo
3 comments
 
The scope within the linking function is available to the directive template.  In the forked example, this is where the 'Mrs Directive' name model comes from.

The source of this model could equally be isolated scope models bound from attributes: eg. 'Miss Attribute' in this example: http://plnkr.co/edit/5WOqhuXtTCTdMHlvCmFU
Add a comment...

Ryan Zec

Discussion  - 
1
Mike McElroy's profile photo
2 comments
 
Oh, I think I see the issue. That's a really confusing plunk, mate.
Add a comment...

Ryan Zec

Discussion  - 
 
This is a preview of a side projects I have been working on:

http://docdemo.ryanzeclabs.com/

This uses a modified version of yuidocs to generate the files for the documentation.  I have added angular specific tags but also changed the output of yuidocs to just JSON files (except for the source code files).  This would allow the generated documentation to be able to be pulled into really any of application.

The application used to display the documentation is using AngularJS (what else would I use :)).  It has most of the baseline functionality I would look for in such an application and a overall style I'm good with.  There are still some features I was to add like being able to search on component items without having a component selected (like searching : date : and seeing a list of all components that have a property, method, event, etc... with date in the name).  There is probably a bit of tweaking to the UI that will be done too.

Hopefully within the next few weeks I will have my version of the yuidocs and the doc app up on GitHub.  Any feedback and suggestions would be welcomed and greatly appreciated.
2
Add a comment...
People
In his circles
392 people
Have him in circles
73 people
Vanya Dineva's profile photo
shamail saidi's profile photo
Wesley Carr's profile photo
Work
Occupation
Senior Front-End Engineer
Employment
  • OnForce
    Senior Front-End Engineer, 2012 - present
  • Netprospex
    Tech Lead, 2011 - 2012
  • FreeCause
    Senior Software Engineer, 2010 - 2011
  • StudentCity.com
    Lead Web Developer, 2006 - 2010
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Woburn MA
Links
Story
Introduction
My name is Ryan and I am a professional web developer mainly dealing with PHP, HTML, CSS, and Javascript/jQuery.  I am also a hobbyist game developer using the Unity game engine.
Education
  • Peabody Memorial Veterans High School
    Electronics, 2000 - 2004
Basic Information
Gender
Male