Coder Social home page Coder Social logo

angularjs-style-guide's People

Contributors

feelepxyz avatar greysteil avatar jackfranklin avatar maxmurdoch avatar simon-johansson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angularjs-style-guide's Issues

Not loading data in the controller

Hey,

Love this style guide, just a quick question. You mention injecting ready data (https://github.com/gocardless/angularjs-style-guide#inject-ready-data-instead-of-loading-it-in-the-controller).

With this in mind how do you handle interacting with services? I currently have something like this

githubService.getAllRepos().then(function (data) {
    ctrl.repos = data.data;
});

What would be the correct way to refactor this so I can use the extend functionality? Thanks guys :)

Where should I put angular.filter ?

I personally think that I should always use global filter, put it globally, not locally.

Seems you didn't provide where I should put it, should it be in /helpers ? on anywhere else ?

index.html

Hello guys,

I'm interesteg in how does look your index.html in relation to this code:

import {mainModule} from './main';

angular.element(document).ready(function() {
  angular.bootstrap(document.querySelector('[data-main-app]'), [
    mainModule.name
  ], {
    strictDi: true
  });
});

I guess you don't have ng-app directive and looking for data-main-app attribute. I have organized my apps similar like that with angular.bootstrap method, but now have some problems with including ui-router in it, Can't find any online resource for using ui-router without ng-app directive.

Thanks a lot.

import angular

Do you have global angular object created by including angular.js file or you imports angular somehow in every file where it is needed?
something like:

import angular from './js/angular.js'

angular.module('myModule"...

Angularjs best ways of making apps compared, including this one

First off, thanks a million for the great compilation of wisdom.

I have included this as the GoCardless Way among my collection of ways here to make an Angular app. I also added to the list of factors several new ones from your style guide. They're in the Design section under Approaches. If you'd like to help out with its accuracy or add things I missed, just send me a request to share the doc and I'll add you as an editor.

Inject ready data for directive-controllers

The guide mentions serving ready data to controllers. That's straight forward for route-controllers,
but with directives there's no such thing as resolv. How do you handle data specific to a certain directive?

Use standard facilities or reference external dependencies used in the examples

Just adopted this guide on a new project and digging it. Here are some things that slowed me in the adoption (with opinion on how to change them):

  • Not being used to $stateProvider (from ui-route I believe) I'd expect it to be replaced by $routeProvider or a reference to be provided
  • The use of UnderscoreJS should be avoided as it implies a dependency or a reference be provided
  • A ES6 module transpiler to IE5 should be suggested (or a list of production ready one provided)

Why one module per file?

Why do most of the Style guides are recommending to use one module per file? Isn't a module supposed to be a reusable, self-contained part of an application? Like a bundle. I don't see how a single file is supposed to be as such when it is asking for dependencies for other files.

To me, a module is a component of the application, which is composed of multiple files. Example:

  • UserAPI Module: User Entity, User related directives (such as User validation), User resources, User Factories, User filters (ex: fullName)...
  • Dashboard Module: Group of controllers and views for the Dashboard part of the application. With its directives and filters and related services.
  • Common/Core module: Global utilities and directives to be shared across modules...

I can understand the need to work like ES6/CommonJS modules, however the angular module definition is much clearer to regroup files under a common cause, the same way Java Packages or Symfony bundles are doing.

Production

I'm interested in how you guys concatinate/minify your apps? In last few days I'm trying to set some work flow with systemjs features for importing modules but also with external (my own) js libs in ec6, and all of that compiled in one single minified js. What is you expiriance with ithat?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.