jerel / ember-cli-clock Goto Github PK
View Code? Open in Web Editor NEWMake the passing of time observable in your Ember app.
License: MIT License
Make the passing of time observable in your Ember app.
License: MIT License
So I am trying to inject the clock service in my model. But it will not start unless I interact with the clock service.
clock: Ember.inject.service('booking-counter'),
isAvailable: Ember.computed('deadline', 'isbookable', 'clock.time', 'clock', function() {
console.log(this.get('clock'));
if(!this.get('isbookable')) {
return false;
}
return moment(this.get('deadline')) > moment();
})
If I take out the console log the service will not start. Any ideas on what I am doing wrong?
In Ember 1.13 I am getting the following warning:
DEPRECATION: In Ember 2.0 service factories must have an `isServiceFactory` property set to true.
You registered (unknown mixin) as a service factory. Either add the `isServiceFactory` property
to this factory or extend from Ember.Service.
Seems like app/services/clock.js
should be extending Ember.Service
instead of Ember.Object
When a project is configured to use a pod structure, this addon doesn't scaffold into the appropriate location.
expected (example assumes config/environment.js
to have no podModulePrefix
set)
ember g clock my-clock --pod
installing service
create app/my-clock/service.js
installing service-test
create tests/unit/my-clock/service-test.js
actual
ember g clock my-clock --pod
installing service
create app/services/my-clock.js
Running the app will give an import error: Uncaught Error: Cannot find module 'my-project/services/my-clock'
and is resolved upon moving the file to the appropriate pod structure location.
Anyone have an example of this?
I'm happy to write this and submit a PR, but I want to know if it's a) in scope and b) wanted before I write it.
Basically, the use case is having Clock's hour/quarter/five/minute methods tick at the same time (or close enough) to wall clock time, so properties that should update on the hour/minute/etc can just observe clock.method instead of doing some other tricky things
The easiest way I can see to do that is to set the initial value to be seconds past the hour or seconds past midnight.
Would this be valuable?
In its API, there is no way to define and use a specific timezone, which can differ from the user country.
This addon is outdated with the recent Ember versions
[email protected]:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ember-cli-clock/-/ember-cli-clock-2.1.1.tgz#342d18f14eddc855dd91d448e85296d6a2482077"
dependencies:
ember-cli-babel "^5.1.5"
$> ember -v
ember-cli: 2.14.1
node: 8.2.1
os: darwin x64
I found your lib through npm search and all the links there, from package.json, are inaccessible. Fortunately there was a link to the demo page in the README.md and a link on the demo page to Github.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.