Thanks, David. That could be the problem. When using :compile :simple, are 
externs ignored?

Cheers,

Jamie

On May 13, 2015, at 12:27 PM, David Nolen <[email protected]> wrote:

> There is no guarantee that using the library itself as the extern will work. 
> In fact you should be surprised if it works unless the library follow strict 
> conventions.
> 
> David
> 
> On Wed, May 13, 2015 at 12:23 PM, Jamie Orchard-Hays <[email protected]> 
> wrote:
> Hoping someone might have some insight that can help with this.
> 
> I'm using Twitters Typehead (0.9.3, before its big rework) in a 
> re-frame/reagent app.
> 
> Below is a snippet that works fine when :compile :simple is used, but fails 
> when :compile :advanced is used. I'm using the typeahead.js and hogan.js as 
> externs. It seems to me that :advanced must be stripping something out the is 
> needed, but no clue how to determine what it is and more importantly what to 
> do about it. When (js/alert...) is called, the value is undefined under 
> :advanced, though the proper object is there, just without values for .-casrn 
> or .-common_name.
> 
>     (reagent/create-class
>      {:component-did-mount
>       (let [params {:name "casrns"
>                     :valueKey "casrn"
>                     :remote
>                     {:url 
> "/raw_materials/casrn_cn_auto_complete.json?casrn=%QUERY",
>                      :cache true}
>                     :limit 20
>                     :template "<div style='width:300px'>{{casrn}}: 
> {{common_name}}</div>"
>                     :engine js/Hogan}]
>         (fn [self]
>           (js/$
>            (fn  [] (.typeahead (js/$ "#casrn") (clj->js params))
>              (.on (js/$ "#casrn")
>                   "typeahead:selected"
>                   (fn  [o, datum]
>                     (let [casrn (.-casrn datum)
>                           common_name (.-common_name datum)]
>                       (js/alert (.-casrn datum))
>                       (update :casrn casrn)
>                       (update :common_name common_name)
>                       (.val (js/$ "#common_name") common_name))))))))
> 
> --
> Note that posts from new members are moderated - please be patient with your 
> first post.
> ---
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.
> 
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to