Examples of NgInject


Examples of com.google.gwt.angular.client.NgInject

    }
    if (sw == null) {
      return typeName + AngularConventions.IMPL;
    }
    String controllerName = type.getSimpleSourceName();
    NgInject ngInject = type.getAnnotation(NgInject.class);
    if (ngInject != null) {
      controllerName = ngInject.name();
    }
   
    JClassType scopeClass = findScopeClass(type,types);

    String scopeAdapter = null;
View Full Code Here

Examples of com.google.gwt.angular.client.NgInject

        if (isScope(type,types)) {
          in.ngName = "$scope";
        } else if (isElement(type,types)) {
          in.ngName = "$element";
        } else {
          NgInject ngInject = type.getAnnotation(NgInject.class);
          if (ngInject != null) {
            in.ngName = ngInject.name();
          } else {
            //Placeholder class or interface
          }
        }
        injects.add(in);
View Full Code Here

Examples of com.google.gwt.angular.client.NgInject

    }
    sw.println("var module = $wnd.angular.module('" + modName + "', []);");
    if (deps != null) {
      int i = 0;
      for (Class<?> clazz : deps.value()) {
        NgInject ngInject = clazz.getAnnotation(NgInject.class);
        final String compInstance = "args[" + i++ + "]";
       
        // automatically adding inject based on classname to filters that are not annotated
        if (Filter.class.isAssignableFrom(clazz)) {
          FilterGenerator.generateFilter(context,sw,clazz,ngInject,compInstance);
        } else if (ngInject != null) {
        // is an injectible
         
          if (AngularController.class.isAssignableFrom(clazz)) {
            // is a controller
            sw.println(compInstance
                + ".@"
                + AngularController.class.getName()
                + "::register"
                + "(Lcom/google/gwt/core/client/JavaScriptObject;)(module);");
          } else {
            // is a service
            sw.println("module.factory('" + ngInject.name()
                + "', function() {");
            sw.indent();
            JClassType serviceType = context.getTypeOracle().findType(clazz.getName());
            generateService(sw, compInstance,serviceType);
            sw.outdent();
View Full Code Here

Examples of com.google.gwt.angular.client.NgInject

    List<Injection> injects = new ArrayList<Injection>();
    for (JField f : dType.getFields()) {
      if(f.isAnnotationPresent(NgInjected.class)) {
        JClassType pType = f.getType().isClassOrInterface();
        if (pType != null) {
          NgInject pInject = pType.getAnnotation(NgInject.class);
         
          if (pInject != null) {
            injects.add(Injection.create(pType, f.getName(),pInject.name()));
          }
        }
      }
    }
    return injects;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.