Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
EVGA Longoria
Dec 25, 2005

Let's go exploring!

an skeleton posted:

AngularJS question ahead:
I'm trying to turn off a save button based on one of the inputs inside of an ngGrid (populated dynamically based on data) being invalid. It may not be possible, but does anyone have any bright ideas?

What are you using to determine if it's valid or not? I'm assuming adding ng validations to the template? I don't see anything in the API that could be doing it otherwise.

Can you post the HTML and JS that are creating and populating this grid?

Adbot
ADBOT LOVES YOU

EVGA Longoria
Dec 25, 2005

Let's go exploring!

an skeleton posted:

How do you detect the cell change?

http://angular-ui.github.io/ng-grid/

afterSelectionChange function (rowItem, event) {} Callback for when you want to validate something after selection.

It's a grid option, so you just give it the callback. Edit is a selection event, so you're probably doing this anyway.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Dangerllama posted:

^^ For the next two hours, Manning has all their JS books at 50% off, including AngularJS in Action.

I'm also curious if anyone has read Secrets of the JavaScript Ninja and would recommend it for varying levels of JavaScript ability.

AngularJS in Action will probably be really good in about 6 months. Right now, it's so empty.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

more like dICK posted:

I "installed" angular by downloading the files and putting them in a 'static/js' directory in my project.

I feel like I don't understand Web 3.0 because apparently I was supposed to use Node.js and something called Bower to do this??

Bower is just a package manager for website libraries.

It handles things like dependencies and keeping your libraries up to date for you, like any package manager. So if you have AngularJS + Bootstrap + Bootstrap-Angular + UI-Router all together, it can get a bit frustrating to manage all of that. That's where Bower is great.

Just using AngularJS? Drop that SOB in your JS folder. Or, even better, use one of the open CDNs for it (GoogleCDN is the official one @ https://developers.google.com/speed/libraries/devguide#angularjs ) -- no need to even download it in that case, and you might speed up your user's experience some too.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

NovemberMike posted:

IIRC it's literally a git wrapper. It just goes to the git repository for the project, finds the right tag, excludes a bunch of files that somebody specified and downloads the rest.

Yeah, this. It's basically all up to the package author how it's laid out. Half of them are just dist files, half are a full distribution including src and tests. It really is crap, but it's the kind of crap that comes about when working backwards with no central authority.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Bower is a step in the right direction. It's even a good first step.

It could really use a central authority dictating some guidelines (release in the package, source in package-devel for instance) and enforcing them.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Huragok posted:

The drawback of using Polymer is it doesn't play nicely with older browsers.

In before "don't you mean bonus?"

Though, to be honest, I think we are at a point where legacy browsers can be ignored for modern web apps. The auto update processes in every browser are a lot better, I don't see much old school usage.

Adbot
ADBOT LOVES YOU

EVGA Longoria
Dec 25, 2005

Let's go exploring!

CSS performance question: Is it better to have one block of rules with a lot of selectors up top, or a lot of duplicate blocks with simple selectors up top?

Basically, a coworker is using extend-only selectors in SASS for things like our buttons. Our code is clean when we write it, but we end up with generated CSS that makes me want to die:

CSS code:
nav.lander section.search input[type="submit"]:disabled, section.jobs button:disabled, button.action.paginate:disabled, .registration-form button.continue:disabled, .button:disabled,
button:disabled,
input[type="submit"]:disabled, nav.lander section.search input[disabled][type="submit"]:hover, section.jobs button[disabled]:hover, button[disabled].action.paginate:hover, .registration-form button[disabled].continue:hover, [disabled].button:hover,
button[disabled]:hover,
input[disabled][type="submit"]:hover, nav.lander section.search input[disabled][type="submit"]:active, section.jobs button[disabled]:active, button[disabled].action.paginate:active, .registration-form button[disabled].continue:active, [disabled].button:active,
button[disabled]:active,
input[disabled][type="submit"]:active, nav.lander section.search input.disabled[type="submit"], section.jobs button.disabled, button.disabled.action.paginate, .registration-form button.disabled.continue, .disabled.button,
button.disabled,
input.disabled[type="submit"], section.jobs button.disabled:hover, .disabled.button:hover,
button.disabled:hover,
input.disabled[type="submit"]:hover, section.jobs button.disabled:active, .disabled.button:active,
button.disabled:active,
input.disabled[type="submit"]:active {
  color: #BBBBBB;
  border-color: #CCCCCC;
  background-color: transparent;
  cursor: not-allowed; }
Is this more efficient than 4 identical blocks with shorter selector lists?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply