alexcheng1982 / angular-timezone-select Goto Github PK
View Code? Open in Web Editor NEWTimezone select for AngularJS
Home Page: http://alexcheng1982.github.io/angular-timezone-select/
License: MIT License
Timezone select for AngularJS
Home Page: http://alexcheng1982.github.io/angular-timezone-select/
License: MIT License
The $watch
expression for country
scope property is defined as attrs.country
, which is attribute string value. Your example demonstrates "country"
attribute value, which leads to watching scope.country
property, resulting in correct behaviour.
If the country
attribute value is changed to something ditterent it results in watching non-existent scope property and not applying country selection at all.
To check this behaviour, you can rename TimeZoneSelectCtrl
's $scope.country
property and change the country directive element attribute value in template accordingly.
I am using Ruby on Rails and 'rails-assets' service to install bower packages.
When trying to install your package I get an error.
It happens because I use lodash 3.10.0 but you require 2.4.1
Bundler could not find compatible versions for gem "rails-assets-lodash":
In Gemfile:
rails-assets-angular-timezone-select (>= 0) ruby depends on
rails-assets-lodash (~> 2.4.1) ruby
rails-assets-lodash (3.10.0)
I got this error when implementing angular-timezone-select into my project with bower:
_.mapValues is not a function
.
Looks like a lodash error. How to prevent this? Will this be fixed?
It seems to not work anymore on latest angular: https://plnkr.co/edit/tTZ4RGsRpai2BWauT6CQ?p=preview
Do you have any ideas how to make it work?
There is a newValue === oldValue
check in scope $watch
listener for ngModel
property, which prevents controller-side changes to be reflected in directive.
I have integrated your plugin in my project, but I couldn't use the search function, It always returned No matches found when I typed something . Could you please help me to check it ?
If the ng-model
is already set with a value, the component does not display it. For example, I have this in my html:
<select ng-model="timezone"></select>
And in my controller I have:
$scope.timezone = window.moment.tz.guess();
But the select box is still displaying no value. Also, not sure if it is related, but the cross to delete the current value appears and the placeholder does not, then on first click the dropdown will open, on second click on the cross the value will be erased and the placeholder will appear.
The Common
and Other
groups are being set in English, any way to change them to other languages? maybe add some data-translations
attribute or something to override them
In your example, you set ng-model="timezone"
, which will populate the timezone
as a string. Any way to retrieve the actual offset of the timezone along?
Hello,
Our project uses npm, can this be added to npm?
Regards,
This is not directly an issue of angular-timezone-select, which I think is great.
The issue is that in my yo angular-fullstack project, this one bower_component breaks when minimized, etc. i.e. grunt server:dist breaks.
However if I just insert the proper files by hand:
link rel="stylesheet" href="bower_components/angular-timezone-selector/dist/angular-timezone-selector.min.css"
script src="bower_components/moment-timezone/builds/moment-timezone-with-data-2010-2020.js"
script src="bower_components/chosen/chosen.jquery.min.js"
script src="bower_components/angular-timezone-selector/dist/angular-timezone-selector.min.js"
Then grunt serve:dist runs properly.
So what are the special settings need to properly perform the uglify, minimization?
I already have:
uglify: {
options: {
mangle: false
},
},
Thanks!
Maybe I'm just confused, but I don't understand the groupBy over an empty array...
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.