Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing happens after loading the layout #48

Open
AshwinTayson opened this issue Apr 24, 2017 · 0 comments
Open

Nothing happens after loading the layout #48

AshwinTayson opened this issue Apr 24, 2017 · 0 comments

Comments

@AshwinTayson
Copy link

Hello,

I am new to Angular 2 and I'm trying to use this library for our new app. I'm using it as below , modifying the example given. After everything I don't see any change it in the images. No absolute positioning is applied on the images. Just images aligned vertically with various height and width. Am I missing something?

home.component.ts

import { NgModule, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { MasonryModule } from 'angular2-masonry';
import {BrowserModule} from '@angular/platform-browser';


@NgModule({
  imports: [
    MasonryModule, BrowserModule
  ],
  schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
  declarations: [ DashboardHomeComponent ],
  bootstrap: [ DashboardHomeComponent ],
})

@Component({
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})

export class DashboardHomeComponent {
	home = true;
}

home.component.html

<masonry>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/1.jpg'></masonry-brick>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/2.png'></masonry-brick>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/3.jpg'></masonry-brick>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/4.png'></masonry-brick>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/5.jpg'></masonry-brick>
    <masonry-brick class="brick"><img src='./assets/img/dashboard/6.jpg'></masonry-brick>
</masonry>

home.component.css

.brick { 
  width: 100px;
  margin: 5px;
  padding: 15px;
}

.brick img {
	max-width: 100%;
}

app.component.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';

import { AppComponent } from './app.component';
import { LayoutComponent } from 'layout/layout.component';

import { HomeComponent } from 'home/home.component';
import { AboutComponent } from 'about/about.component';
import { FeaturesComponent } from 'features/features.component';
import { PricingComponent } from 'pricing/pricing.component';
import { DashboardComponent } from 'dashboard/dashboard.component';
import { DashboardHomeComponent } from 'dashboard/home.component';
import { ProfileComponent } from 'profile/profile.component';
import { DesignComponent } from 'design/design.component';
import { LoginComponent } from 'login/login.component';
import { SignupComponent } from 'signup/signup.component';
import { LogoutComponent } from 'logout/logout.component';

@NgModule({
  declarations: [
    AppComponent,
    LayoutComponent,
    AboutComponent,
    FeaturesComponent,
    PricingComponent,
    DashboardComponent,
    DashboardHomeComponent,
    DashboardProjectComponent,
    DashboardActivityComponent,
    DashboardAssetsComponent,
    DashboardTeamComponent,
    ProfileComponent,
    DesignComponent,
    LoginComponent,
    SignupComponent,
    LogoutComponent,
    HomeComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot([
      { path: 'about', component: AboutComponent },
      { path: 'features', component: FeaturesComponent},
      { path: 'pricing', component: PricingComponent },
      { path: 'dashboard', component: DashboardComponent, children: [
          {
              path: 'home',
              component: DashboardHomeComponent
          },
          {
              path: 'projects',
              component: DashboardProjectComponent
          },
          {
              path: 'activity',
              component: DashboardActivityComponent
          },
          {
              path: 'assets',
              component: DashboardAssetsComponent
          },
          {
              path: 'teams',
              component: DashboardTeamComponent
          },
          {
              path: '',
              redirectTo: 'home', pathMatch: 'full'
          }
      ] },
      { path: 'profile', component: ProfileComponent },
      { path: 'app', component: DesignComponent },
      { path: 'login/{type}', component: LoginComponent },
      { path: 'signup/{type}', component: SignupComponent },
      { path: 'logout', component: LogoutComponent },
      { path: '', component: HomeComponent}
    ], { useHash:false })
  ],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [NO_ERRORS_SCHEMA]
})
export class AppModule { }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant