type == "routine"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OldNode | |
def lesson | |
@lesson ||= Lesson.find(id) | |
end | |
def verify_migration | |
self.verify_field_names | |
self.verify_sections | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.PlanbookDate = Ember.Model.extend({ | |
/** | |
* Computed Property | |
* This property returns a routine. If the routine is pristine, | |
* it creates a routine then adds parts from the routine template to it. | |
* | |
* If the routine is not pristine, it just returns the routine. | |
* | |
*/ |
Ember does a bunch of useful, powerful, magical things that makes life easy. However, I find myself often a loss to understand how the magic works or how to hook into it. I think I struggle most to understand how & when things are instantiated, how they magically know of each other (e.g. the app knows all it's models & controllers), and how to instantiate things manually and give them access to all the other classes. Here are some examples:
- If I create an instance of a controller, how do I make sure it has access to the app containers?
- In Ember-CLI, how does Ember know about all the models/controllers/etc I create? When I write
export default PostController
, how does Ember register that as a controller and add it to the container? - In Ember-CLI, filenames & folder names make a difference. If files are named something unexpected, the documentation writes that they need to be imported automiatcally. Where would such an import statement go? What is the code path that the abnormally named class has to ski
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SortableListMixin from '../mixins/sortable-list'; | |
import Part from '../models/part'; | |
import Section from '../models/section'; | |
var PartsController = Ember.ArrayController.extend(SortableListMixin, { | |
init: function(){ | |
this._super() | |
// ISSUE #1 - probably unrelated the es6 change. | |
// Shouldn't the content be set automatically to an array? | |
if (Ember.isNone(this.get('content'))){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uvOptions = {}; | |
// Include the UserVoice JavaScript SDK (only needed once on a page) | |
(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/API_KEY.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})() | |
UserVoice=window.UserVoice||[]; | |
function showClassicWidget() { | |
UserVoice.push(['showLightbox', 'classic_widget', { | |
primary_color: '#cc6d00', | |
link_color: '#007dbf', | |
forum_id: 140171 | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var smoke = TS.HomeSmokeView.create({signal: "Magically Generating Your Schedule. Hold on.<br>Magic can't be rushed."}).append() | |
Ember.run.schedule('afterRender', this, function(){ | |
this.get('queue').forEach(function(course) { | |
course.schedule() | |
}) | |
this.get('queue').clear() | |
smoke.destroy() | |
}) |
[ snip ]
The router drives an Ember app. The router translates the URL into a model that is rendered with a template. Optionally, you can use controllers and views for more control. Controllers hold application state that isn't expressed in the URL. Views back templates and can handle events.
[ snip ]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="selected-standards"> | |
<ul> | |
{{#each selected in view.context.standards}} | |
<li class="box selected-triad"> | |
<span {{ action toggleStandard selected view target="view.context"}}> {{selected.shortCode}} </span> | |
</li> | |
{{/each}} | |
</ul> | |
</div> |