3.0.8 • Published 1 month ago

ember-cli-mdc-layout v3.0.8

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
1 month ago

ember-cli-mdc-layout

ember-cli support addon for layout-based logic

Installation

ember install ember-cli-mdc-layout

Services

This package contains the following services.

Layout Service

The layout service is used to query information about the current device layout. Its primary purpose is to support device-specific layouts in template definitions. The layout service has the following properties:

  • isPhone - Test if the current layout is for a phone
  • isTablet - Test if current layout is for a tablet
  • isDesktop - Test if the current layout is for a desktop

Usage

You use the layout service by injecting it into either a controller or component. Here is a controller were we inject the layout service.

// controllers/index.js

import Controller from '@ember/controller';
import { inject as service } from '@ember/service';

export default Controller.extend ({
  layout: service ()
});

We can then use the layout service to add conditional blocks based on different device layouts.

// templates/index.js
<div>We are now viewing this applicaiton on a 
  {{#if layout.isPhone}}
  phone.
  {{else if layout.isTablet}}
  tablet.
  {{else if layout.isDesktop}}
  desktop.
  {{/if}}
</div>
3.0.8

1 month ago

3.0.0

3 months ago

3.0.0-alpha.21

2 years ago

3.0.0-alpha.20

2 years ago

2.8.5

2 years ago

2.0.19

3 years ago

2.0.12

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.0-octane.49

3 years ago

2.0.0

3 years ago

2.0.0-octane.48

3 years ago

2.0.0-octane.47

3 years ago

2.0.0-octane.46

3 years ago

2.0.0-octane.45

3 years ago

2.0.0-octane.43

3 years ago

2.0.0-octane.39

3 years ago

2.0.0-octane.42

3 years ago

2.0.0-octane.41

3 years ago

2.0.0-octane.40

3 years ago

2.0.0-octane.38

3 years ago

2.0.0-octane.37

3 years ago

2.0.0-octane.35

3 years ago

2.0.0-octane.36

3 years ago

2.0.0-octane.34

3 years ago

2.0.0-octane.33

3 years ago

2.0.0-octane.32

3 years ago

2.0.0-octane.31

3 years ago

2.0.0-octane.30

3 years ago

2.0.0-octane.28

3 years ago

2.0.0-octane.27

3 years ago

2.0.0-octane.26

3 years ago

2.0.0-octane.24

3 years ago

2.0.0-octane.23

3 years ago

2.0.0-octane.25

3 years ago

2.0.0-octane.22

3 years ago

2.0.0-octane.17

3 years ago

2.0.0-octane.19

3 years ago

2.0.0-octane.18

3 years ago

2.0.0-octane.21

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.8

4 years ago

2.0.0-octane.16

4 years ago

2.0.0-octane.15

4 years ago

2.0.0-octane.14

4 years ago

2.0.0-octane.13

4 years ago

2.0.0-octane.12

4 years ago

2.0.0-octane.11

4 years ago

2.0.0-octane.10

4 years ago

2.0.0-octane.9

4 years ago

2.0.0-octane.8

4 years ago

2.0.0-octane.7

4 years ago

2.0.0-octane.6

4 years ago

2.0.0-octane.5

4 years ago

2.0.0-octane.4

4 years ago

2.0.0-octane.3

4 years ago

1.0.0

4 years ago

1.0.0-alpha.0

5 years ago

0.80.4

5 years ago

0.80.0

5 years ago

0.79.0

5 years ago

0.78.2

5 years ago

0.78.1

5 years ago

0.76.0

5 years ago

0.75.0

5 years ago

0.74.8

5 years ago

0.74.0

5 years ago

0.73.0

5 years ago

0.72.0

5 years ago

0.71.0

5 years ago

0.70.2

5 years ago

0.70.0

5 years ago

0.69.0

5 years ago

0.68.0

5 years ago

0.67.0

5 years ago

0.66.0

5 years ago

0.65.0

5 years ago