Socket
Book a DemoInstallSign in
Socket

fd-angular-core

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fd-angular-core

Personal Angular utils

Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

fd-angular-core

Requirements

  • a Promise polyfill.

Getting started

import {bootstrap, State} from 'npm:fd-angular-core';

@State({
  template: `<p>{{ app.message }}</p>`
})
class AppController {

  constructor() {
    this.message = "Hello world!";
  }

  activate() {
    // can return a promise
  }

  attach() {

  }

  detach() {

  }

}

bootstrap(AppController); // => Promise

@Inject

@Inject('$scope')
class Foo {

  constructor($scope) {}

  @Inject('$scope')
  aMethod($scope) {}

}

$injector.superConstruct and $injector.superCall

class Foo extends Bar {

  constructor($injector) {
    $injector.superConstruct(this);
    // or:
    // $injector.superConstruct(this, locals);
  }

  aMethod($injector) {
    $injector.superCall(this, "aMethod");
    // or:
    // $injector.superCall(this, "aMethod", locals)
  }

}

@Service

@Service
// or: @Service('Foo')
class Foo {}
// this service is injectable as 'Foo'

@Controller

@Controller
// or: @Controller('Foo')
class Foo {}
// this controller is injectable as 'Foo'

@Component

@Component
// or: @Component({ ... })
class FooController {}
// this component can be used as `<foo>` or `<div foo></div>`
// and uses the `./components/foo/foo.html` template

options: restrict, scope, template, templateUrl

Set template to false to prevent the default template from being used.

Keywords

utils

FAQs

Package last updated on 26 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts