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
/* i2c_restart - Example | |
For other examples please check: | |
https://github.com/espressif/esp-idf/tree/master/examples | |
This example code is in the Public Domain (or CC0 licensed, at your option.) | |
Unless required by applicable law or agreed to in writing, this | |
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
CONDITIONS OF ANY KIND, either express or implied. |
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 Ember from 'ember'; | |
import layout from '../templates/custom'; | |
export default Ember.Component.extend({ | |
layout, | |
}); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
prop1: Ember.computed(function() { | |
return '1) read only prop'; | |
}).readOnly(), | |
prop2: Ember.computed({ | |
get() { | |
return '2) computed only get'; |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
userService: Ember.inject.service('user'), | |
userController: Ember.inject.controller('user'), | |
actions: { | |
incrementController() { | |
this.incrementProperty('userController.counter', 1); | |
}, | |
decrementController() { |
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 Ember from 'ember'; | |
const { computed } = Ember; | |
function value(x) { | |
if (typeof x === 'undefined') { | |
return false; | |
} else if (x === null) { | |
return false; | |
} else { |
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 Ember from 'ember'; | |
const { | |
inject: { service }, | |
} = Ember; | |
export default Ember.Controller.extend({ | |
product: service(), | |
}); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
showPopup: false, | |
actions: { | |
blurA() { | |
this.set('showPopup', false); | |
}, | |
focusA() { | |
this.set('showPopup', true); |
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 Ember from 'ember'; | |
function boolOr() { | |
var propertyNames = Array.prototype.slice.call(arguments); | |
var computed = Em.computed(function() { | |
var properties = {}; | |
for (var i = 0; i < propertyNames.length; i++) { | |
properties[propertyNames[i]] = Em.get(this, propertyNames[i]); | |
} | |
for (var key in properties) { |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
mail: Ember.inject.service(), | |
actions: { | |
toggleFolder(mail) { | |
mail.toggleProperty('trashed'); | |
} | |
} |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |