Registry / web-framework / a1atscript

a1atscript

JSON →
library0.5.0jsnpmunverified

a1atscript (v0.5.0) is a polyfill for Angular 2 style annotations and dependency injection, designed to work with Angular 1.x. It allows developers to use Angular 2-like syntax (e.g., @Controller, @Service, @Component, @View) when building Angular 1 applications, provided an ES6 transpiler like Babel or Traceur is used. The library supports module definition, bootstrap, and integration with the new Angular router. It is currently in an early, experimental stage with slow release cadence and limited adoption; no security issues have been reported. It serves as a bridge for teams transitioning from Angular 1 to Angular 2.

npm install a1atscript
INSTALL
IMPORT
SIG · A1ATSCRIPT
A
a1atscript
web-frameworkjavascriptv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Controller
import { Controller } from 'a1atscript'
import Controller from 'a1atscript'
Named export; default import not available.
Service
import { Service } from 'a1atscript'
var Service = require('a1atscript').Service
ES module; CommonJS require still works but not recommended.
Module
import { Module } from 'a1atscript'
const { Module } = require('a1atscript')
Named export; used for creating Angular modules.
bootstrap
import { bootstrap } from 'a1atscript'
import { bootstrapModule } from 'a1atscript'
Named export; bootstrap function takes a module and optional prefix.
Component
import { Component } from 'a1atscript'
import { Component as NgComponent } from 'a1atscript'
Named export; used as annotation.
View
import { View } from 'a1atscript'
Named export; used as annotation for component templates.

Shows how to define a service and controller using annotations, create a module, and bootstrap the app.

import { Controller, Service, Module, bootstrap } from 'a1atscript'; @Service('MyService') class MyService { constructor() { this.value = 42; } } @Controller('MyController', ['$scope', 'MyService']) class MyController { constructor($scope, MyService) { $scope.value = MyService.value; } } const appModule = new Module('myApp', [MyService, MyController, 'ngRoute']); bootstrap(appModule, 'app');
Debug
Known issues
gotchaRequires ES6 transpiler (Babel or Traceur) for annotations to work. Not compatible with plain ES5.
fix
Use a build system with Babel or Traceur to transpile code before running.
affects: >=0.1.0
gotchaThe library is a polyfill for Angular 2 style but only covers a subset of features; not all Angular 2 patterns are supported.
fix
Consult the Angular 2 migration guide and use official upgrade tools for complex scenarios.
affects: <=0.5.0
deprecatedThe Angular new router (angular-new-router) integration is experimental and may not be maintained.
fix
Consider using UI-Router or ngRoute for routing.
affects: >=0.3.0
Errors
Common errors & fixes
Module is not defined
Forgetting to import Module or using it without transpiler.
fix
Ensure you have 'import { Module } from 'a1atscript'' and a transpiler is set up.
Error: [$injector:modulerr] Failed to instantiate module
Incorrect module dependencies or circular dependency.
fix
Check that all referenced modules are correctly imported and no circular dependencies exist.
Annotation is not a function
Using annotations without transpiler or incorrect import.
fix
Ensure you are importing the annotation correctly and using a transpiler that supports decorators (e.g., Babel with legacy decorator plugin).
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
54 hits · last 30 days
node
45
Google (search)
1
OpenAI (training)
1
Resources
a1atscript — npm install a1atscript · libregistry