Skip to content

Instantly share code, notes, and snippets.

@kirjs
Created December 5, 2015 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirjs/dfc34f3de8e8c922d985 to your computer and use it in GitHub Desktop.
Save kirjs/dfc34f3de8e8c922d985 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://code.angularjs.org/tools/system.js"></script>
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.44/angular2.dev.js"></script>
<script>
System.config({
transpiler: 'typescript',
typescriptOptions: { emitDecoratorMetadata: true }
});
</script>
</head>
<body>
<my-app></my-app>
</body>
</html>
import {bootstrap, Component} from 'angular2/angular2';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
class AppComponent { }
bootstrap(AppComponent);
@syonfox
Copy link

syonfox commented Dec 20, 2023

How do we do the same thing reducing the number of tings a user must learn

what is @
is component a function or a class if it is a cases whats wrong with new?
also someone might saw why new if its a function let it be new_component(config)

The @Component() decorator identifies the class immediately below it as a component, and provides the template and related component-specific metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment