多页角度开发

I have to create multi page angular framework using ng boilerplate. We have modular component based approach and single component can be created multiple times on same page. For example I can have 2 instance of carousel component on home page and there configuration and slides parameter for image path etc are coming from ajax. Now challenge is that this ajax url is dynamic and there is no fixed pattern so I cant hard code in my js. is there any way I can pass this dynamic url from template to my $http request?

Something like this in

<div ng-controller="CarouselCtrl" carouselUrl="<dynamic url>">
    <div class="container slider">
        <ul>
            <li ng-repeat="slide in slides">//..</li>
        </ul>
    </div>
</div>

You can pass attributes to controllers only in directives. Moreover, you might rethink having your CarouselCtrl logic in separate directive, as this is clearly the case where this should be done.