This file contains hidden or 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
| // from https://www.youtube.com/watch?v=vvZEddrClAQ&feature=youtu.be | |
| export default Ember.Component.extend({ | |
| draw(){ | |
| if (this._state !== 'inDOM') return; | |
| let data = this.get('data'); | |
| // do d3 stuff | |
| }, |
This file contains hidden or 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
| http://emberjs.com/api/data/classes/DS.RootState.html | |
| * root | |
| * deleted | |
| * saved | |
| * uncommitted | |
| * inFlight | |
| * empty | |
| * loaded | |
| * created |
This file contains hidden or 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
| http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/ | |
| $ git branch | |
| * master | |
| twitter_integration | |
| $ git checkout twitter_integration app/models/avatar.rb db/migrate/20090223104419_create_avatars.rb test/unit/models/avatar_test.rb test/functional/models/avatar_test.rb | |
| $ git status | |
| # On branch master | |
| # Changes to be committed: | |
| # (use "git reset HEAD <file>..." to unstage) |
This file contains hidden or 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
| amilkey [7:35 PM] | |
| @ everyone what you use for forms? | |
| i looked at ember addons that work with Ember 2.0 and didn't find anything | |
| pixelhandler [7:36 PM] | |
| @amilkey: I use a component for the form and have status for editing and previewing and sometimes use the buffered proxy addon to delay changes to the model | |
| pixelhandler [7:39 PM] | |
| and use a flag for new too, when previewing I make the inputs disabled |
This file contains hidden or 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
| https://github.com/emberjs/data/issues/772 | |
| I think there is a kind of Conccurent modification, you're walking through the list | |
| and delete one element at the same time. I think the run.once defers the deletion after the loop has been made. | |
| To avoid it, I think you could iterate over a copy instead of the content. Something like | |
| @get("content").toArray().forEach(article) -> | |
| article.deleteRecord() | |
| forEach uses Array.prototype.forEach which is basically: |
This file contains hidden or 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
| Процесс обработки WEB-страницы браузером | |
| Для начала, рассмотрим последовательность работы браузера при отображении документа: | |
| Из полученного от сервера HTML-документа формируется DOM (Document Object Model). | |
| Загружаются и распознаются стили, формируется CSSOM (CSS Object Model). | |
| На основе DOM и CSSOM формируется дерево рендеринга, или render tree — набор объектов рендеринга (Webkit использует термин «renderer», или «render object», а Gecko — «frame»). Render tree дублирует структуру DOM, но сюда не попадают невидимые элементы (например — <head>, или элементы со стилем display:none;). Также, каждая строка текста представлена в дереве рендеринга как отдельный renderer. Каждый объект рендеринга содержит соответствующий ему объект DOM (или блок текста), и рассчитанный для этого объекта стиль. Проще говоря, render tree описывает визуальное представление DOM. | |
| Для каждого элемента render tree рассчитывается положение на странице — происходит layout. Браузеры используют поточный метод (flow), при котором в большинс |
This file contains hidden or 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
| COMPONENT LIFECYCLE HOOKS | |
| A number of new component lifecycle hooks have been introduced to Ember 1.13. Using these hooks allows you to write data down, action up (DDAU) style components today, despite the two-way data binding of curly components. | |
| On first render (in order): | |
| didInitAttrs runs after a component was created and passed attrs are guaranteed to be present. In Ember 1.13, the attributes will be available as this.get('attrName'). | |
| didReceiveAttrs runs after didInitAttrs, and it also runs on subsequent re-renders, which is useful for logic that is the same on all renders. It does not run when the component has been re-rendered from the inside. | |
| willRender runs before the template is rendered. It runs when the template is updated for any reason (both initial and re-render, and regardless of whether the change was caused by an attrs change or re-render). | |
| didInsertElement runs after the template has rendered and the element is in the DOM. |
This file contains hidden or 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
| delegate methods to proxy object | |
| proxyToContent = (method) -> | |
| -> | |
| content = Ember.get(@, 'content'); | |
| content[method].apply(content, arguments) | |
| appointment: Ember.computed 'pet.id', -> | |
| appointment = Promise() |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName:'Ember Twiddle', | |
| vehicle: '', | |
| vehicles: [1,2,3], | |
| }); |
This file contains hidden or 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
| http://blog.trackets.com/2013/02/08/router-request-lifecycle.html | |
| Router Request Lifecycle | |
| enter (private) | |
| activate - executed when entering the route | |
| deserialize (private) | |
| model (formely deserialize) - takes the params and returns a model which is set to the route's currentModel | |
| serialize - used to generate dynamic segments in the URL from a model | |
| setupController - takes currentModel and sets it to the controller's content by default | |
| renderTemplate - takes current controller and what model returns and renders the template with an appropriate name |