Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.
https://famo.us/angular
Mozilla Public License 2.0
1.92k stars 275 forks source link

fa-container-surface does not support removing children #166

Closed mkuczera closed 10 years ago

mkuczera commented 10 years ago

As the title says. Is there any workaround available to remove fa-container-surface on StateChange?

mkuczera commented 10 years ago

sorry, my view code is this:

 <fa-app style="position: absolute; top: 0; left: 0; right: 0; bottom: 0;" >

    <fa-modifier 
        ng-repeat="item in items"
        id="entryHolder{{$index}}"
        fa-translate="[transX.get(),240+{{$index}}*180]"
        fa-size="[1570-{{$index}}*60,145]"
        fa-animate-enter="entryHolderEnterAnimation({{$index}})"
        fa-animate-leave="entryHolderEnterAnimation({{$index}})">

        <fa-container-surface>
            <fa-modifier
                fa-skew="[0,0,-.35]">
                <fa-surface fa-size="[undefined, undefined]"
                    fa-color="'#000'"
                    fa-padding="'0 78px 0 84px'"
                    fa-properties="{lineHeight: '145px'}"
                    class="entryHolder{{$index}}">
                    <div class="skewedContent">
                        <h2 style="float: right;">{{item.title}}</h2>
                        <h4 style="float: left;">{{item.content}}</h4>
                    </div>
                </fa-surface>
            </fa-modifier>
        </fa-container-surface>

    </fa-modifier>

    </fa-app>

And i want to switch the ui-view content with another fb-app when the user clicks a link.

dziwoki commented 10 years ago

Hi, I've solved it little differently (using directive and poor renderNode + ui-router). Would post in by weekend if that is ok with you (need to update it to newest famo.us version). The behaviour of elements is controlled via event (in controller). If you need that earlier write me on skype: jakub.dziwoki

zackbrown commented 10 years ago

Have you tried just using <ui-view>? You can use a ui-view normally (vanilla Angular) outside of an fa-app, like <div ui-view></div> (and then have different fa-apps in your different templates, just like http://github.com/thomasstreet/famous-angular-examples project.)

If you want to substitute out rendertree elements with a router, as of 0.3.0 you can use ui-view inside of your fa-app. Check out the discussion at https://github.com/Famous/famous-angular/pull/137#issuecomment-53110250 for an example.

zoneblaze commented 10 years ago

Is fa-container-surface going to support removing children eventually? Basically I am working on a kiosk app where I need to be able to remotely destroy/rebuild the view according to new JSON config updates without having to refresh the browser.

zackbrown commented 10 years ago

This should be resolved now with 422576a573 . I tested this in famous-angular-examples and it appears to work (https://github.com/thomasstreet/famous-angular-examples/commit/717a87700f8ab45bdc7e6d8b71344b7fea3b54e9) There's a bit more conversation in #194, where @steveblue had implemented an alternative solution. Let me know if you're still having any trouble after 422576a5 .