Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-translate-json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-translate-json - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

4

index.ts

@@ -28,7 +28,7 @@ // Imports

})
export class Angular2TranslateJsonModule {
export class AngularTranslateJsonModule {
public static forRoot(): ModuleWithProviders {
return {
ngModule: Angular2TranslateJsonModule,
ngModule: AngularTranslateJsonModule,
providers: [

@@ -35,0 +35,0 @@ TranslateService

{
"name": "angular-translate-json",
"version": "0.2.3",
"version": "0.3.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "index.ts",

@@ -1,4 +0,6 @@

# Angular(latest) Translate Json
Inspired by https://github.com/angular-translate/angular-translate
# Angular Translate Json
Translations module for latest version of angular.
*Inspired by https://github.com/angular-translate/angular-translate*
It's built to support latest angular version, with a friendly to use api.

@@ -11,3 +13,3 @@

// Imports
import { Angular2TranslateJsonModule, TranslateService } from 'angular-translate-json';
import { AngularTranslateJsonModule, TranslateService } from 'angular-translate-json';

@@ -18,3 +20,3 @@

imports: [
Angular2TranslateJsonModule.forRoot(),
AngularTranslateJsonModule.forRoot(),
]

@@ -63,2 +65,37 @@ })

}
```
```
##### 4. More options to use it
You could either use it as a atttribute(directive) or pipe, or simply by calling the service directly.
##### Directive
```html
<div class="greet" translate="COMMON.HELLO"></div>
```
##### Pipe or filter
```html
<div class="greet">{{'COMMON.HELLO' | translate}}</div>
```
##### Using the service
```typescript
import { TranslateService } from 'angular-translate-json';
@Component({
template: `{{myNameIs}} {{name}}`
})
class NameBadgeComponent {
myNameIs = '';
name = 'John Snow';
constructor( private translateService: TranslateService ) {
translateService.getTranslation('COMMON.HELLO')
.subscribe(res => {
this.myNameIs = res;
});
}
}
```
## Feedback
Let me know if there's something broken and I'll be more than happy to address it.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc